How to change the password on Linux

  • Updated

Just like any other operating system, it's important to regularly change your password on Linux-based systems like Ubuntu and Linux Mint. This can help ensure the security and integrity of your data.

In addition, when you first set up a Virtual Desktop, one of the first actions you should take for the sake of security is to change the password for both the administrator and root account. The credentials you choose during the VM setup are stored in the hosting provider's database and are not meant to be used long-term: you should be the only one who knows your password.

Here's how you can change your password on Ubuntu or Linux Mint.

Step 1: Open the Terminal

The Terminal, sometimes referred to as the console or command line, is where you'll input all your commands. You can open the Terminal by pressing Ctrl + Alt + T on your keyboard.

Step 2: Change your or someone else's password

Once the Terminal is open, you can change your password using the passwd command. If you want to change the password for another user you need to use sudo like this: sudo passwd username. Here's how to do it:

  1. Type passwd (or sudo passwd username) into the Terminal and press Enter.
  2. You will be prompted to enter your current (or root) password, then press Enter.
  3. You'll then be asked to enter the new password, then press Enter.
  4. For security reasons, you'll be asked to retype the new password, then press Enter again.

Once you've completed these steps, the password has been changed.

Remember that a strong password is one of the first lines of defence in maintaining your system's security. As an administrator, you have the power to safeguard your system from unauthorized access. So, be sure to use a robust, unique password and change it regularly. If you forget your password, you will need to reset it in recovery mode or from a Live CD/DVD.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.