-
Login via SSH:
Use an SSH client like Terminal or PuTTY:If you're logged in as another user with
sudoprivileges, use: -
Change the Root Password:
If you're logged in as root:
If you're logged in as another user with sudo privileges:
-
Enter and Confirm the New Password:
You'll be prompted to:-
Enter the new password
-
Retype it to confirm
If successful, you’ll see:
-
⚠️ Tips:
-
Make sure you use a strong password.
-
If root login is disabled via SSH (which is common for security), enable it by editing
/etc/ssh/sshd_configand setting:Then restart SSH:
