Skip to content

How to Change the Password

Qi Luo edited this page Jul 3, 2019 · 2 revisions

If you prefer interactive SONiC CLI

Please use below command

sudo passwd USER

and input password twice.

USER is the user name, for example 'admin'.

You should have sudo privilege to run it.

If you prefer single line solution

Please use below command line to change specific user's password. You should have sudo privilege to run it.

echo USER:$(LANG=C perl -e 'print crypt("PASSWORD", "salt"),"\n"') | sudo chpasswd -e

USER is the user name, for example 'admin'. PASSWORD is the new password for the user.

Clone this wiki locally