Do you bore to enter the same password again and again? OR Someone knows your password and access your system in your absence.
Password is a key to protect your system from those, who are not authorized. If you want to protect Linux System or other systems, Change the password periodically.
Become habitual to change the password from time to time. When you change the password don’t forget about password policy.
I am telling you silently, Hacker can crack your Linux password easily. 2 minutes is enough to crack the password.
This post is not about how to crack password, It is about How to change password in Linux system.
Now I am coming on the point How to change password in Linux by the terminal without wasting more time.
- How to change password in Linux of current user [logged in User]
- How to change
passwordin Linux of another user
- Force user to change password at next Login.
- How to change
passwordin Linux by GUI [Ubuntu 19.04]
How to change
password in Linux of current user [logged in User]
You can change the password by using simple command passwd. No matter which type of user you are a normal user, sudo user or root user.
You must know the password of the current user. The system will verify your authorization.
If you don’t know the current password means you are not an authorized, person.
Don’t try to change the password if not authorized. This comes under cybercrime. and it may send you Jail.
It will ask for the current password, give it and enter the new password twice. Typing character and star will not display on the screen, but don’t worry type complete password whatever asked.
[email protected]:~$passwd Changing password for vijay. Current password: New password: Retype new password: passwd: password updated successfully [email protected]:~$
Now you have changed the password successfully.
How to change
password in Linux of another user
It is the next challenge for you to change the password of another user in Linux. So do you want to learn it? If yes read continue…
Either you must be a sudo user or root user, to change the password in Linux of other users.
If you are a sudo user then you must know the current password, if you are a root user no problem for the current password anymore.
$sudo passwd username
[email protected]:~$sudo passwd cyrage [sudo] password for vijay: New password: Retype new password: passwd: password updated successfully [email protected]:~$
If you are confuse to see the available users you can check my old post about How to check list users in Linux
Force user to change password at next Login
You have been working as Linux Administrator and you find some suspicious activities by cyrage user.
So you can force cyrage user to change the password before doing anything. If he must know the current password to set a new password.
[email protected]:~$sudo passwd --expire cyrage [sudo] password for vijay: passwd: password expiry information changed. [email protected]:~$
You can see a demonstration below:
[email protected]:~$su cyrage Password: You are required to change your password immediately (administrator enforced) Changing password for cyrage. Current password: New password: Retype new password: [email protected]:/home/vijay$whoami cyrage [email protected]:/home/vijay$
How to change password in Linux by GUI [Ubuntu 19.04]
Graphical User Interface (GUI) is a very loved interface by people. Most people don’t like using the terminal. So if you are one of them, Nevermind, You can change the user password in Linux by GUI.
Step#1 Go to Account Settings:
Click on the drop-down menu at Right-Top corner > Username > Account Settings.
Step #2 Click on the password.
New windows will be pop-up after a click on account settings, Click on password area is displayed on the screen.
Step #3 Change Password
Provide Current password and New password twice, then click on the change to proceed forward.