Knowledge Base

How to Change a User's Password in Linux

Linux logo

This article will show you how to change a user's password in Linux.

Changing a user's password in Linux can be accomplished using the passwd command. Here's how to do it:


How to Change Your Own Password

1. Log in to your SSH account

Open a terminal and log in with root or sudo access.

2. Change the User's Password

You can change your user's password using the passwd command:

sudo passwd

You'll be prompted to enter a new password for the user and confirm it.

How to Change Another User's Password

1. Log in to your SSH account

Open a terminal and log in with root or sudo access.

2. Change the User's Password

You can change the user's password using the username option:

sudo passwd username

Replace username with the actual username.

You'll be prompted to enter a new password for the user and confirm it.

Important Considerations

  • Ensure you have the necessary permissions to change another user's password.
  • Always choose strong, unique passwords to maintain system security.

Next: How to Expire a User's Password in Linux covers forcing a change at next login.

Please rate this article to help us improve our Knowledge Base.

0 0