How to reset Root Password in OS level on Linux Cloud Servers

2020-08-18 By Ryan 1371 Views linux password root
66 reviews

The root is the username or account that, by default, has access to all commands and files on a Linux or other Unix-like operating system. It is also referred to as the root account, root user, and the superuser.


This guide outlines the steps to reset root password inside OS level in Linux server (E.g. CentOS, Ubuntu and Debian).


  1. First access server by using SSH with the current password and run the below command to change the password.

    # passwd root
    

    *It will ask to Enter the new UNIX password as shown in the below image.

    rootreset1

  2. Now enter the new strong password and retype it in the next step and press Enter.

    rootreset2

  3. Now you can use the new password. If you need to generate a strong password, then run the below command from the server before trying to change the password. Here using SHA to hash the date, runs through base64, and then outputs the top 20 characters.

    # date +%s | sha256sum | base64 | head -c 20 ; echo
    

    rootreset3


Related Tutorials

What do you think about this article?

Rate this article