/etc/ssh/sshd_config
RSAAuthentication yes # 启用 RSA 认证,默认为yes
PubkeyAuthentication yes # 启用公钥认证,默认为yes
generate client public and private key
ssh-keygen -t rsa
Step 3
cat id_rsa.pub >> .ssh/authorized_keys
prevent user from login by password
/etc/sshd/sshd_config
PasswordAuthentication no
modify mode
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys