The instructions below can be used to change the root password on your Ubuntu server using SSH and a few basic commands.


Step 01 :

Log in to the server via SSH

Step 02 :

If you're logged in as the root user, all you have to do is type:

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


Step 03 :

You won't need to type "sudo" if you already have root permissions.

If you've created a user named "root," you can also change it to that person. Your existing user's password will be changed if you just write "passwd" in that field.

Here is an example of a shorter command used by a root user to change their own password:

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


In this way, we can change the root user's password. 

Hope this article help you to know How to change root user password on ubuntu server

Share