Whether you’re running macOS, Windows, or Linux, it’s crucial to be mindful of your password and change it regularly. So, how do you change your password in Linux? It’s a pretty straightforward process, so let’s take a look.

Recommendations for Strong Passwords

No matter what platform you’re on, strong passwords are vital to keeping your information secure. You should follow some basic precautions and routines, which will help reduce the chances of a security breach. These include:

Change your passwords regularly. As a general rule, it’s wise to change your password at least every 90 days. Many experts actually recommend password changes once a month.Use strong passwords. The strongest password will always be more than eight characters long. In truth, the longer the better, but there are often limits to how many characters you can use. For tips on creating strong passwords that you can still remember, be sure to check out our guide on that very subject. One additional suggestion is to make sure your password incorporates a mix of lower case letters, capitalized letters, numbers, and symbols.Never reuse passwords. Using the same password on multiple computers or websites is a dangerous habit to get into. Sure, it may make it easier to remember your passwords, but it also increases the threat if someone guesses it. Use unique passwords everywhere, and make sure you don’t use the same passwords again when you change them.

If you’re happy to follow these typical rules, you shouldn’t have any problem coming up with a secure password for your Linux PC.

How to Set a Linux Password Using the Terminal

The simplest way to set a new Linux password is to use the passwd command in a terminal or SSH window. To use it, open a new terminal window, or connect remotely using SSH (if you’re able to do this). To set a new Linux password using passwd: That’s all it takes to change your own password, but what if you want to change the password for another user account? Assuming you have sudo privileges, that’s still easy. To set another user’s password on Linux: Note that the above steps can be used to change the password for the root user, too. When you go through the process, you’ll enter the command sudo password root.

Additional Password Administration Using passwd on Linux

There’s quite a bit more you can do with the passwd command in Linux. If you have multiple accounts on your PC, you can lock a password so the user can no longer use it (they can still use an SSH public key authentication for remote connectivity). You can then unlock the password, allowing the user to log in that way again. If someone’s forgotten their password, you can delete it so they can log in and set a new one. Here’s a quick look at some of actions you can perform using passwd:

Lock a password: passwd -l Unlock a password: passwd -u Delete a password: passwd -d

In all examples, replace the example with the username you’re administering. Other options will let you set how many days must pass before the user can change a password, how long a password remains valid before expiring, and more. These options are likely beyond the scope of this how-to, but checking the man file for passwd will give more information.

How to Use GUI Tools to Change Passwords on Linux

Both Gnome Desktop and KDE have tools for user management, including changing your password, using a graphical user interface. If you’re more comfortable using point-and-click methods to change your Linux password, here’s how to make that happen.

In Gnome, Use the Users Application

If your Linux install uses Gnome Desktop (like Ubuntu), you can change your password from the Users section of Settings. It’s important to note that you cannot change the root user’s password this way. There are more steps involved than changing your password from the terminal, but this is a good option for anyone looking to avoid opening the terminal. To use Users to change the password on Ubuntu:

Changing Passwords in a KDE Environment

If you’re running a KDE desktop environment (eg. Kubuntu), there’s a GUI tool available to change your password. This only supports user passwords—you can’t change the root password here. To change your password using KDE:

Setting a Password Policy You Can Live With

The steps above should help you to change your Linux password. Make sure to set up a password policy on your Linux PC that offers you plenty of security, but gives you a password that you can still live with. Changing passwords daily won’t help much if you use sticky notes to remember them, for example. You should also try to avoid passwords that are easy to guess—as long as you can remember it. You may want to consider using a password manager, such as 1Password or Enpass, to help you generate and remember new passwords. Both of these apps, and others, are available on Linux, but also support other platforms including Windows, Android, iOS, and macOS. Finally, whenever possible, take advantage of Two-Factor Authentication (2FA) on your PC and your accounts. This helps tremendously if your password does get compromised, since it requires your confirmation on another device before it can be used. Comment Name * Email *

Δ  Save my name and email and send me emails as new comments are made to this post.

How to Change Your Linux Password - 86How to Change Your Linux Password - 96How to Change Your Linux Password - 2How to Change Your Linux Password - 71How to Change Your Linux Password - 7How to Change Your Linux Password - 78How to Change Your Linux Password - 19How to Change Your Linux Password - 4How to Change Your Linux Password - 35How to Change Your Linux Password - 81How to Change Your Linux Password - 60