configure the sshd server to disable password login and enable keys.

First - We need to generate a pair of keys.

ssh-keygen -v -t rsa -b 2048

and then

cat /home/buddy/.ssh/buddy_rsa.pub > /home/buddy/.ssh/authorized_keys

Editing the config file /etc/ssh/sshd_config

vi /etc/ssh/sshd_config

login to remote server using the password to configure the sshd server to disable password login and enable keys.

vi /etc/ssh/sshd_config

And then edit…

PermitRootLogin no
#Disable Login password
#PasswordAuthentication no
ChallengeResponseAuthentication no
#Allow forwarding yes
AllowTcpForwarding no

# Uncomment ‘PasswordAuthentication no’ line only after making sure that the key authentication is working properly.
# Disabling root login is recommended anyway, though not useful after disabling login password.
# Allow forwarding is not recommended for multi user hosting envirnoment where keys could be exposed. Anyway, we should only allow it if we intend to forward keys from server to server but keep all our keys on the local machine.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.