How to Change the Password - Staphylo/SONiC GitHub Wiki
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.