Linux系统ssh启用密钥登录

82 阅读1分钟
cd ~/.ssh

ssh-keygen -t rsa -b 4096

cat id_rsa.pub >> authorized_keys

登录测试

ssh -i id_rsa username@host

禁用密码登录

sudo vim /etc/ssh/sshd_config
PasswordAuthentication no