In this tutorial you will learn how to change the user password on Ubuntu Server using passwd command.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# Change user password on Ubuntu Server # Check if the user is created cat /etc/passwd # Change user ID to a user without a password set su liviu.balan ssh liviu.balan@http.liviubalan.com # Change own user password for a user without a default password sudo su liviu.balan # A normal user may only change the password for his own account, while the superuser may change the password for any account sudo passwd # Change user password sudo passwd liviu.balan # Change own user password su liviu.balan passwd # -d Delete a user's password (make it empty) sudo passwd -d liviu.balan sudo passwd liviu.balan # -e Immediately expire an account's password. This in effect can force a user to change his/her password at the user's next login sudo passwd -e liviu.balan # Display account status information. The status information consists of 7 fields. # The first field is the user's login name. The second field indicates if the user account has a locked password (L), # has no password (NP), or has a usable password (P). The third field gives the date of the last password # change. The next four fields are the minimum age, maximum age, warning period, and inactivity period # for the password. These ages are expressed in days sudo passwd -aS # passwd man page man passwd |