User management

All SONiC devices support both the serial console based login and the SSH based login by default. The default credential for login is admin/YourPaSsWoRd. In case of SSH login, users can login to the management interface (eth0) IP address after configuring the same using serial console. Refer the next section for configuring the IP address for management interface.

Debian GNU/Linux 10 sonic ttyS0

sonic login: admin
Password: YourPaSsWoRd
Last login: Tue Feb 15 17:47:19 UTC 2022 on ttyS0
Linux sonic 4.19.0-12-2-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64
You are on
  ____   ___  _   _ _  ____
 / ___| / _ \| \ | (_)/ ___|
 \___ \| | | |  \| | | |
  ___) | |_| | |\  | | |___
 |____/ \___/|_| \_|_|\____|

-- Software for Open Networking in the Cloud --

Unauthorized access and/or use are prohibited.
All access and/or use are subject to monitoring.

Help:    http://azure.github.io/SONiC/

admin@sonic:~$

Configuring Username & Password

There is no separate CLI for adding users and for changing passwords. Users shall use the linux commands “useradd” command to add new users. Users shall use the linux command “passwd ” to change the password for the specific username.

How to reset Password

This section gives the instruction of how to reset a SONiC switch password.

  • Edit Grub boot menu options

1. First you need to get into grub menu options. This menu is displayed right at the beginning of the boot. You should get something similar to this, but not the exactly the same. Choose the choice Start with SONiC-:

                             GNU GRUB  version 2.02

 /----------------------------------------------------------------------------\
 |*SONiC-OS-202012-nb-inno.0-25af05a8                                         |
 | ONIE                                                                       |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 \----------------------------------------------------------------------------/

      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, `e' to edit the commands

 2. Now we attempt to edit grub’s boot option. Press “e” to edit the first grub menu option and navigate to kernel line:

sonic edit grub

3. Remove quiet and add init=/bin/bash

sonic_reset_pass_2

4. Press Ctrl-x to boot

  • Remount / and /proc

1. After successfully boot you will be presented with bash command prompt:

sonic_reset_pass_3

mount -o remount,rw / 
mount -o remount,rw /proc
  • Reset password

1. To reset an actual password is now simple as typing : passwd admin

sonic_reset_pass_4

sync
reboot -f
NEWS

Latest news