Changing Passwords

  1. Using the Linux Command Line
  2. The Linux Directory Tree
  3. Linux Shells and Basic Commands
  4. Changing Passwords
  5. Your Home Directory
  6. User Information
  7. Linux User Default Files
  8. Linux User Profiles and Paths
  9. sudo and su –
  10. Listing Files and Going Deep Into Filesystems
  11. Linux: Creating and Deleting Directories and Files

You can change your own password, or if you are an admin you can also change the passwords of other users.

To change the password for your currently logged-in user:

passwd
# Enter existing password
# Enter new password
# Enter new password again (to validate)

To change the password for the user ‘roger’ (only if you are logged in as root):

passwd roger
# Enter new password
# Enter new password again (to validate)