p:: CLI
root
user
sudo su
Set root
password
passwd
New password:
Retype new password:
passwd: password updated successfully
Enable root login over SSH
vim /etc/ssh/sshd_config
Add below lines to end of file
PermitRootLogin yes
PasswordAuthentication yes
Save file and Restart SSH Server
systemctl restart sshd
Copy Public Key to your laptop using ssh-copy-id
ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
ssh [email protected]
Disable Password Authentication
vim /etc/ssh/sshd_config
Change below values
PermitRootLogin prohibit-password
PasswordAuthentication no
Save file and Restart SSH Server
systemctl restart sshd