Unix Command To Change Password

I am a new Unix user at my university/school. In Unix, how do I change my password to safeguard and increase the security of my Unix account?

It is a good idea to change your password every month or at least every four months.
Tutorial details
Difficulty level Easy
Root privileges No
Requirements None
Est. reading time 1m
Make sure you use combination of alphabets (upper and lower case characters), numbers, and special characters as a password to safeguard your account. You should choose a password of at least ten characters. Do not write down your username and password. Do not share your password or send anyone via email, even if the email or sysadmin requesting your password seems official. A request for a password via email is very likely a phishing scam.

passwd command syntax

You need to use the Unix passwd command to change your password. The syntax is:


The Unix will prompt you for your old password, ask for a new password, and force you to repeat your new password for verification. Please note that Unix passwords are case sensitive. The above command will change the password only on the computer or server you are currently using. If you are logged on nas01 server the password will only on the nas01 sever and not on nas02 or any other Unix based server/computer.

Sample demo

Animated gif 01: The Unix passwd command demo. Learn how to change your Unix password.

For more information please see passwd command man page.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum