• Increase font size
  • Default font size
  • Decrease font size
change password

 How can I change my root password

$su -l root

 

[root@H]# passwd

Changing password for user root.

New UNIX password: 

Retype new UNIX password: 

passwd: all authentication tokens updated successfully.

 

 

 

 Type passwd command as follows

# passwdOutput:

Changing password for user root.
New UNIX password: 
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.
 

 Usage: passwd [OPTION...]

  -k, --keep-tokens       keep non-expired authentication tokens
  -d, --delete            delete the password for the named account (root only)
  -l, --lock              lock the named account (root only)
  -u, --unlock            unlock the named account (root only)
  -f, --force             force operation
 
  -x, --maximum=DAYS      maximum password lifetime (root only)
  -n, --minimum=DAYS      minimum password lifetime (root only)
  -w, --warning=DAYS      number of days warning users receives before
                          password expiration (root only)
  -i, --inactive=DAYS     number of days after password expiration when an
                          account becomes disabled (root only)
  -S, --status            report password status on the named account (root
                          only)
  --stdin                 read new tokens from stdin (root only)
 
Help options:
  -?, --help              Show this help message
  --usage                 Display brief usage message
 
 
You can use the passwd command to change your log-in password, and as you can tell from the man output shown in the preceding section, you have quite a few options. Here are some of the most common:
 
passwd   Change your own password.
passwd sleepy   Change sleepy's password.
 
passwd -d sleepy   Delete sleepy's password.
 
When you enter one of these commands to change a password, you will be prompted for the old (current) password and a new password. Your new password should be at least six characters long and not too easy for someone else to guess. Oh, and writing it down on a scrap of paper taped to your monitor is not recommended either. :-)
 
If you share your Linux system with multiple users, or if you have a dial-in modem attached, password security for each account is particularly important. But if you're the only one who will ever lay a finger on your system, you might want to delete your password, thus removing the need to enter it each time you log in. It's your call, but you never know when your five-year-old will wander by the keyboard!
 
By the way, you might get the idea from the preceding commands that users can go around changing each other's passwords at will, but that's not the case. Only a superuser (such as root) can change or delete another user's password.