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 superuser.
This guide outlines the steps to reset root passwords inside the OS level in the Linux server (E.g. CentOS, Ubuntu and Debian).
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.
Now enter the new strong password
and retype it in the next step and press Enter
.
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
Related Tutorials