How To Set or Change Linux User Password?
How To Set or Change Linux User Password?
How do I set or change Linux system password for any user account? How can I change user password on Linux operating system using the command-line options?
Farjanul Nayem Answered question December 12, 2022
Linux Set User Password
- Open the Linux terminal application.
- Type following passwd command command to change your own password:
passwd
Sample output:
Changing password for vivek (current) UNIX password: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
Linux change password for other user account
- Open the Linux terminal application.
- You need to login as the root user using the su command or sudo command:
sudo su
- Then as the root user, type the passwd command followed by the username. For example, to change password for user named ‘vivek’, run:
passwd vivek
Sample session:
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
Farjanul Nayem Answered question December 12, 2022