Home / VPS & Dedicated / Managing passwords in Linux with the "passwd" command

Managing passwords in Linux with the "passwd" command

Root password
When managing a dedicated server, it is very important to keep a secure password and to change it periodically. In an SSH session, the best way to accomplish this is to use the “passwd” command. A normal user can change his/her own account, while a system administrator (root) can change any account’s password on the system.

In Linux, there are certain requirements for passwords. The “passwd” command is configured to reject passwords that appear to be too easy to guess, particularly those that match common usage words. To change the password of the current user, just type passwd with nothing following it. To change the password of any other user, log in as root and then enter:

passwd username

It will ask you for a new password and then ask you to type the password again to confirm it. A good password will be 6 to 8 character and contain both lowercase letters and numbers. Another trick you can use to make sure a user changes his or her password is to use the “-e” flag. Enter:

passwd -e username

This will cause the user’s password to expire and force the person to change the password at his/her next login.

Photo Source: Flickr

Check Also

servers

Importance of web hosting to business

The world of business is very ruthless and unfair in some cases. It is a …