---
title: Basic Configuration and Login
slug: aidc/basic-configuration-and-login
description: basic configuration
createdAt: 2025-12-01T11:13:09.458Z
---

## <font color="#1d50a2">First Login</font>

AsterNOS switches support both serial plaintext-based logins and SSH-based logins. The default login credential is admin/asteros.
After initial power-on, you can log in via the serial plaintext to set the IP address of management port (mgmt 0) (refer to management port configuration). Afterward, SSH login is enabled using the management IP.

### <font color="#1d50a2">Console Login</font>

**\[Use Cases]**

```plaintext
Debian GNU/Linux 9 sonic ttyS0
sonic login: admin
Password:
Linux sonic 5.10.0-8-2-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64
    _          _                _   _   ___   ____
   / \    ___ | |_   ___  _ __ | \ | | / _ \ / ___|
  / _ \  / __|| __| / _ \| '__||  \| || | | |\___ \
 / ___ \ \__ \| |_ |  __/| |   | |\  || |_| | ___) |
/_/   \_\|___/ \__| \___||_|   |_| \_| \___/ |____/

------- Asterfusion Network Operating System -------

Help:    http://www.asterfusion.com/

sonic#
```

### <font color="#1d50a2">SSH Login</font>

**\[Use Cases]**

```plaintext
[C:~]$ ssh admin@10.250.0.138
Connecting to 10.250.0.138:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
WARNING! The remote SSH server rejected X11 forwarding request.
Linux sonic 5.10.0-8-2-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64
    _          _                _   _   ___   ____
   / \    ___ | |_   ___  _ __ | \ | | / _ \ / ___|
  / _ \  / __|| __| / _ \| '__||  \| || | | |\___ \
 / ___ \ \__ \| |_ |  __/| |   | |\  || |_| | ___) |
/_/   \_\|___/ \__| \___||_|   |_| \_| \___/ |____/

------- Asterfusion Network Operating System -------

Help:    http://www.asterfusion.com/

sonic#
```

## <font color="#1d50a2">Login Config</font>

Table 1 Login Config

| **Command**                                                                                                                                      | **Purpose**                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- |
| **ssh server disbale**                                                                                                                           | Disable SSH service                |
| **ssh ipuser** *user\_name ip\_address* \[**port** *port\_id* \| **interface** *interface\_name* \| **vrf** *vrf\_name* \| **src** *source\_ip*] | Login to other devices via SSH.    |
| **telnet server enable**                                                                                                                         | Enable TELNET service              |
| **telnet ip user** *user\_name ip\_address* \[**vrf** *vrf\_name* \| **src** *source\_ip*]                                                       | Login to other devices via Telnet. |

### <font color="#1d50a2">ssh server disbale</font>

**\[Command]**
**ssh server disbale**

**\[Purpose]**
Disable SSH service.

**\[View]**
Global Configuration View

**\[Notes]**
Default Enable.
Run command **no ssh server disable** to enable SSH service.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)#ssh server disable
After disabling the SSH service, log in to the switch via SSH and prompt login failure
sonic@sonic-Super-Server:~$ ssh admin@10.250.0.171
ssh: connect to host 10.250.0.171 port 22: Connection refused
```

### <font color="#1d50a2">ssh ip user *user\_name ip\_address* \[port *port\_id*|interface *interface\_name*|vrf *vrf\_name*|src *source\_ip*\]</font>

**\[Command]**
**ssh ip user** *user\_name ip\_address* \[**port** *port\_id*|**interface** *interface\_name*|**vrf** *vrf\_name*|**src** *source\_ip*]

**\[Purpose]**
Login to other devices via SSH.

**\[Parameters]**

| **Parameter**     | **Description**   |
| ----------------- | ----------------- |
| *user\_name*      | User name         |
| *ip\_address*     | IP address        |
| *port\_id*        | Port id           |
| *interface\_name* | Interface name    |
| *vrf\_name*       | VRF name          |
| *source\_ip*      | Source IP address |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# ssh ip user admin 10.250.0.167 port 22
admin@10.250.0.167's password:
Linux sonic 5.10.0-8-2-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64
    _          _                _   _   ___   ____
   / \    ___ | |_   ___  _ __ | \ | | / _ \ / ___|
  / _ \  / __|| __| / _ \| '__||  \| || | | |\___ \
 / ___ \ \__ \| |_ |  __/| |   | |\  || |_| | ___) |
/_/   \_\|___/ \__| \___||_|   |_| \_| \___/ |____/

------- Asterfusion Network Operating System -------

Help:    http://www.asterfusion.com/
Last login: Wed Dec 25 10:15:08 2024 from 10.250.0.114
sonic#
```

### <font color="#1d50a2">telnet server enable</font>

**\[Command]**
**telnet server enable**

**\[Purpose]**
Enable telnet service.

**\[View]**
Global Configuration View

**\[Notes]**
Default disbale.
Run command **no telnet server enable** to disable telnet service.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)#telnet server enable
After enabling the Telnet service, log in to the switch using Telnet and the login is successful.
sonic@sonic-Super-Server:~$ telnet 10.250.0.171
Trying 10.250.0.171...
Connected to 10.250.0.171.
Escape character is '^]'.
Debian GNU/Linux 11
sonic login: admin
Password:
Linux sonic 5.10.0-8-2-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64
    _          _                _   _   ___   ____
   / \    ___ | |_   ___  _ __ | \ | | / _ \ / ___|
  / _ \  / __|| __| / _ \| '__||  \| || | | |\___ \
 / ___ \ \__ \| |_ |  __/| |   | |\  || |_| | ___) |
/_/   \_\|___/ \__| \___||_|   |_| \_| \___/ |____/

------- Asterfusion Network Operating System -------

Help:    http://www.asterfusion.com/
Last login: Wed Oct 16 11:00:33 UTC 2024 from 192.168.20.102 on pts/1
sonic#
```

### <font color="#1d50a2">telnet ip user *user\_name ip\_address* \[vrf *vrf\_name* | src *source\_ip*\]</font>

**\[Command]**
**telnet ip user** *user\_name ip\_address* \[**vrf** *vrf\_name* | **src** *source\_ip*]

**\[Purpose]**
Login to other devices via telnet.

**\[Parameters]**

| **Parameter** | **Description**   |
| ------------- | ----------------- |
| *user\_name*  | username          |
| *ip\_address* | IP address        |
| *vrf\_name*   | VRF name          |
| *source\_ip*  | Source IP address |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# telnet ip user admin 10.250.0.167 src 10.250.0.114
Trying 10.250.0.167...
Connected to 10.250.0.167.
Escape character is '^]'.
Password:
Linux sonic 5.10.0-8-2-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64
    _          _                _   _   ___   ____
   / \    ___ | |_   ___  _ __ | \ | | / _ \ / ___|
  / _ \  / __|| __| / _ \| '__||  \| || | | |\___ \
 / ___ \ \__ \| |_ |  __/| |   | |\  || |_| | ___) |
/_/   \_\|___/ \__| \___||_|   |_| \_| \___/ |____/

------- Asterfusion Network Operating System -------

Help:    http://www.asterfusion.com/
Last login: Wed Dec 25 10:19:38 CST 2024 from 192.168.23.198 on pts/0
sonic#
```

## <font color="#1d50a2">CISCO-LIKE View</font>

In order to meet different users' habits, AsterNOS supports two methods of configuration: Linux Bash style and CISCO-LIKE style Command line, which are not compatible with each other.

- **Linux Bash Style**
  Bash mode, also named SONiC Command Line, uses **config** and **show** series of commands to manage the switch. There is no concept of view, and commands are organized independently. The configuration file stores the results of the configuration, rather than the configuration Command.
- **CISCO-LIKE Style**
  CLI mode, also named KLISH Command Line, uses CISCO-LIKE style commands provided by **sonic-cli** to manage the switch. Following the CLI style of traditional commercial switches, commands are organized under views. The configuration file stores the Commands that have been configured.

:::hint{type="info"}
**Attention please:**

- Since the commands and configuration storage of the two configuration interfaces above are not one-to-one correspondence, and there are differences between background processing. Therefore, these two methods cannot be converted synchronously, i.e. they are not compatible. Please do not combine them.
- If you need to change CLI mode during use, we suggest you to clean up the configuration first, otherwise there may be incompatible configuration problems.
- For protection, the system will restart bgp service automatically when cli-mode is changed.
  When logging into the switch, you will enter CISCO-LIKE CLI by default.
:::

Table 2 CISCO-LIKE View

| Command                   | Purpose                          |
| ------------------------- | -------------------------------- |
| **cli-mode \{bash\|cli}** | Change CLI mode of the system.   |
| **configure terminal**    | Enter Global Configuration View. |
| **end**                   | Exit to Privileged User View.    |
| **exit**                  | Exit current view.               |
| **sonic-cli**             | Enter CISCO-LIKE CLI View.       |
| **system bash**           | Change to Bash CLI.              |

### <font color="#1d50a2">cli-mode \{bash|cli\}</font>

**\[Command]**
**cli-mode** \{**bash**|**cli**}

**\[Purpose]**
Change CLI mode of the system.

**\[View]**
Global Configuration View

**\[Notes]**
The default CLI mode is **cli**.
This command is only available for admin and root users.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# cli-mode bash
CLI mode changes to sonic-bash, Some configurations lose and need to be reconfigured. sure? [Y/n]: y
```

### <font color="#1d50a2">configure terminal</font>

**\[Command]**
**configure terminal**

**\[Purpose]**
Enter Global Configuration View.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
admin@sonic:~$ sudo sonic-cli
sonic# configure terminal
sonic(config)#
```

### <font color="#1d50a2">end</font>

**\[Command]**
**end**

**\[Purpose]**
Exit to Privileged User View.

**\[View]**
All Views

**\[Use Cases]**

```plaintext
admin@sonic:~$ sudo sonic-cli
sonic# configure terminal
sonic(config)#
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# end
sonic#
```

### <font color="#1d50a2">exit</font>

**\[Command]**
**exit**

**\[Purpose]**
Exit current view.

**\[View]**
All Views

**\[Use Cases]**

```plaintext
admin@sonic:~$ sudo sonic-cli
sonic# configure terminal
sonic(config)#
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# exit
sonic(config)#
```

### <font color="#1d50a2">sonic-cli</font>

**\[Command]**
**sonic-cli**

**\[Purpose]**
Enter CISCO-LIKE CLI View.

**\[View]**
System Terminal

**\[Notes]**
This command requires root privileges.
After entering CISCO-LIKE CLI, the default view is Privileged User View, which is not allowed to run configuration commands.
If you want to deploy the switch, please run **configure terminal** to enter Global Configuration View.

**\[Use Cases]**

```plaintext
admin@sonic:~$ sudo sonic-cli
sonic#
```

### <font color="#1d50a2">system bash</font>

**\[Command]**
**system bash**

**\[Purpose]**
Change to Bash CLI.

**\[View]**
System Terminal

**\[Notes]**
Running the command **exit** in Bash will return you to the CISCO-LIKE CLI.
This command is only available for admin and root users.

**\[Use Cases]**

```plaintext
sonic# system bash
admin@sonic:~$ exit
sonic#
```

## <font color="#1d50a2">Help</font>

When using KLISH Command, you can use `<Tab>` or `?` at any level to get help information at any level.
This will help you to understand the purpose of the command and the meaning of the parameters, thus you do not need to remember a large number of complex commands.

**\[Command]**
*COMMAND* + `<Tab>` or `?`

**\[Purpose]**
Get help information.

**\[View]**
All Views

**\[Notes]**
Press `<Tab>` when you type a command, the system will automatically complete the keyword or list the set of matching keywords.
Type `?`, the system will give you a message or explanation of the meaning of the corresponding keyword or parameter.
If you type an incorrect command or the command is not for this view, you will not be allowed to type `<enter>`.
If the command line is not typed completely, the system will give a prompt.
`<cr>` means that there is no keyword or parameter in this position, type `<enter>` to run.

**\[Use Cases]**

```plaintext
sonic# show <tab>
acl              arp              counters         history          image            interface        link-aggregation
lldp             mac-address      platform         running-config   startup-config   sub-interface    traffic
sonic# configure terminal
sonic(config)# access-list l3 test ingress <tab>
  <cr>
sonic(config)# access-list l3 test <enter>
Syntax error: The command is not completed
sonic(config)# access-list l3 test1 ingress
sonic(config-l3-acl-test1)# ?
  end   Exit to the exec Mode
  exit  Exit from current mode
  no    Negate a command or set its defaults
  rule  Add an access list entry
  show  show running-config
sonic(config-l3-acl-test1)# rule ?
    rule ID (0..500)
sonic(config-l3-acl-test1)# rule 1 ?
  source-mac        Specify source mac address
  destination-mac   Specify destination mac address
  ethernet-type     Specify ethernet protocol type
  outer-vlan        Specify outer VLAN id
  vlan-pri          Specify outer VLAN priority
```

