Special Offer Get Upto 90% Off InterServer Unlimited SSD Web Hosting and VPS

InterServer Web Hosting and VPS

How to Change User Password in Linux4 Min Read

Do you want to change user password in Linux?

The strength of the user password is mattered when you set the user password.

You need to use very strong user passwords and change them from time to time to keep your data and personal information safe.

In this post, we’ll tell you how to change a user password in Linux.

We’ll also tell you how to force a user to change their password when they logged in.

This example will work with any Linux distribution.

Step-by-Step Change Your Password in Linux

Introduction:

Change password of a user account in Linux you can use the passwd command.

The encrypted user’s password’s as well as other password information is stored in the

<strong>/etc/shadow</strong> file

As a normal user, you can only change your own password no other user’s password. The root user and user’s with sudo command privileges can change another user’s password.

When changing the password makes sure you’re using a unique and strong password.

This is more important things you can do to secure your account. At least 16 characters have a strong password that uses at least one upper case letter, one lower case letter, one number, and one unique character.

If you’re using a Linux Operating System, it’s very easy to change your user password.

It’s very easy to change user password from the command line than it from the graphical user interface (GUI), although that process is very simple as well.

Let’s find out how easy it is to change user password in Linux from both command line and GNOME Desktop.

Change Your User User Password in Linux:

6 Simple Steps’ You should follow to Change Linux User Password:

Changing your user’s account password run the passwd command without any option.

Don’t be panic, it’s very easy to change user password using the command line, Here’s how to use this command:

  1. Open a Terminal Window
  2. Type the command
    sudo passwd
  3. When prompted, type your current user password.
  4. Type the new password and hit enter
  5. Re-type new password to verify password
  6. Close the terminal window.

Congratulations! You’ve successfully changed your user password. That’s it, once you’ve verified the password, you’re ready. There’s no need to logout and login.

Reset User Password in Linux:

If you’ve another user on your Linux machine and you need to change their password?

That’s very easy to use change your own password. Before you do this, however, you want to make sure the user isn’t logged into your system. Here’s how to reset user password:

  1. Open a Terminal Window
  2. Type the command sudo passwd USERNAME; (Where USERNAME is the name of the user whose password you want to change).
  3. Type your password
  4. Type new password for the other user.
  5. Re-type the new password.
  6. Close the Terminal

All done! Once you’ve successfully changed the password, another user attempt to log into their account. They shouldn’t have any problem login in with the new password.

If you’re using a GUI (Graphical User Interface)-

If you love to use a GUI over the command line, how this is done will depend, varying on which desktop you’re using. Lets’ take a look at how to change the password in GNOME Desktop.

Change User Password using GUI:

  1. Open setting tool.
  2. Press on Details
  3. Click Users and then click Unlock.
  4. When prompted, type your current user password.
  5. Click in the Password test area.
  6. When prompted type and verify the new password and click Change.
  7. Close Setting Window.

And finally, successfully change user password using GNOME Desktop. Most of Linux Desktop GUI will offer a very similar means for changing a user password, via a user-friendly GUI. No matter what Desktop or Distribution you use it.

Force User to change the Next Login User Password:

Passwords are set by default to never expire. If you want the next time you log in to force a user to change their password, use the passwd command with the —expire option followed by the user’s username:

$ sudo passwd –expire rytetips

The above command will expire the password of a user account immediately

The next time the user attempts to login with the old password, a message will be displayed forcing them to change their password:

$ ssh [email protected]
Output:

WARNING: Your password has expired.

You must change your password now and login again!

Changing password for rytetips.

(current) UNIX password:

Enter new UNIX password:

Retype new UNIX password:

Passwd: password updated successfully

Connection to 192.168.1.22 closed.

The connection will be closed once the user sets a new password.

Conclusion:

You have learned how to change the passwords of the user and how to set password expiry in this tutorial. For security purposes, continuous updating of your password and using a unique password for each account is suggested.

 

You cannot copy content of this page

How to Change User Password in Linux

Min Read: 3 min
0