SSH cannot login with root pasword
Remove root's plain-text password from /etc/passwd
and add an encrypted one in the /etc/shadow
file
First edit the /etc/passwd
file from:
root:CD.Dnox5Dc2RQ:0:0:root:/home/root:/bin/sh
To:
root:x:0:0:root:/root:/bin/sh
Then create an encrypted password using openssl
command:
admin@ubuntu:~$ openssl passwd -1 CD.Dnox5Dc2RQ
$1$A20/AqQt$zBfgwEGWNRLQsSk3bYV6V.
In this case, the plain-text password is CD.Dnox5Dc2RQ
and the encrypted version is $1$A20/AqQt$zBfgwEGWNRLQsSk3bYV6V.
Then add entries to /etc/shadow
file:
root:$1$A20/AqQt$zBfgwEGWNRLQsSk3bYV6V.:18550:0:99999:7:::
From now on, you will be able to SSH and login as root with a password of CD.Dnox5Dc2RQ
and home directory of /root