Blog / How to change the password of my Linux server

How to change the password of my Linux server

by SW Team

How to change the password of my Linux server

Having a good password policy is crucial not only in your Cloud server, we also recommend you to apply it in your usual services, both in your work and personal environment. Here are some tips:

· Change passwords frequently

· Do not use the same password for different accounts

· Use a combination of upper and lower case letters, symbols and numbers.

· Do not answer 'yes' when asked to save your password on a public computer browser

· Do not use names or numbers associated with you (date of birth, pet names, etc)

· Do not use passwords that are easy to crack, such a '12345' / 'admin'

Here's how to change the password of a Linux system.

Before we start with the tutorial, don't you have a Cloud server with Ubuntu 20.04 or do you prefer a Cloud server already upgraded to Ubuntu 22.04? Don't worry! With just one click, you can easily deploy it with SW Hostin.

cta:cloud_so_ubuntu_20

cta:cloud_so_ubuntu_22

Changing the root password of my Linux server

On Linux operating systems, the password is not displayed in the terminal as you type it during the password change process for security reasons.

Depending on the distribution you are using, the terminal may look slightly different.

In the terminal of your Linux server, type the command passwd

root@cl2024060309001:~# passwd

You will be prompted to enter your password twice.

New password:
Retype new password:
passwd: password updated successfully
root@cl2024060309001:~#

There, you should now have a modified password.

Some Linux systems will ask you for a password strength. The standard is 8 characters.

How to change the password of a user in Linux

The process is similar to the previous one, it would be the passwd command and the user, that is: passwd usuario_a_modificar.

 root@cl2024060309001:~# passwd usuario_a_modificar

We must enter the new password twice.

New password:
Retype new password:
passwd: password updated successfully
root@cl2024060309001:~#

Remember that if you do not yet have a Cloud server with Ubuntu 20.04 or Ubuntu 22.04, or with your favorite operating system, you can easily deploy it with SW Hosting.

cta:cloud_so_ubuntu_20

cta:cloud_so_ubuntu_22

i