How to change the password in Linux terminal by Terminal and GUI in Ubuntu

Vijay Kumar
3 min readMay 18, 2019

--

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 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 the password, It is about How to change the password in Linux system.

Now I am coming on the point How to change the password in Linux by the terminal without wasting more time.

How to change the 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 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 cyber crime. and it may send you Jail.

$passwd

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.

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 confused 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 a cyrage user.

So you can force the cyrage user to change the password before doing anything. If he must know the current password to set a new password.

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

You can see a 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 the 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.

Step #2 Click on the password

New windows will be pop-up after clicking 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.

Originally published at https://www.cyberpratibha.com on May 18, 2019.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response