How to change password in Linux with the help of easy commands and steps

How to change password in Linux with the help of easy commands and steps

Do you bore to enter 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 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 minute 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 terminal without wasting more time.

Article Content

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 user you are normal user, sudo user or root user.

You must know the password of current user. System will verify you authorization.

If you don’t know current password means you are not authorized person.

Don’t try to change the password if not authorized. This comes under cybercrime. and it may send you Jail.

$passwd

It will ask for current password, give it and enter new password twice. Typing character and star will not display on the screen, but dont worry type complete password whatever asked.

vijay@Ubuntu-19:~$passwd
Changing password for vijay.
Current password: 
New password: 
Retype new password: 
passwd: password updated successfully
vijay@Ubuntu-19:~$

Now you have changed the password successfully.

How to change password in Linux of another user

It is next challenge for you to change password of another user in Linux. So do you want to learn it? If yes read continue ….

Either you must be sudo user or root user, to change the password in Linux of other user.

If you are sudo user then you must know the current password, if you are root user no problem for current password anymore.

Simple syntax

$sudo passwd username

vijay@Ubuntu-19:~$sudo passwd cyrage
[sudo] password for vijay: 
New password: 
Retype new password: 
passwd: password updated successfully
vijay@Ubuntu-19:~$

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 new password.

vijay@Ubuntu-19:~$sudo passwd --expire cyrage
[sudo] password for vijay: 
passwd: password expiry information changed.
vijay@Ubuntu-19:~$

You can see demonstration below:

vijay@Ubuntu-19:~$su cyrage
Password: 
You are required to change your password immediately (administrator enforced)
Changing password for cyrage.
Current password: 
New password: 
Retype new password:
vijay@Ubuntu-19:/home/vijay$whoami
cyrage
vijay@Ubuntu-19:/home/vijay$

How to change password in Linux by GUI [Ubuntu 19.04]

Graphical User Interface (GUI) is very loved interface by people. Most people don’t like using terminal. So if you are one of them, Never mind, You can change 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.

33-open-account-settings

Step #2 Click on password

New windows will be pop-up after click on account settings, Click on password area is displayed on the screen.

34-how-to-change-password-in-linux-using-Graphical-interface-GUI

Step #3 Change Password

Provide Current password and and New password twice, then click on the change to proceed forward.

35-change-password-in-linux-ubuntu-19.04

If Appreciate My Work, You should consider:

Leave a Comment