ssh-keygen
在服务器上安装密钥
cd .ssh
cat id_rsa.pub >> authorized_keys
设置正确的权限
chmod 600 authorized_keys
chmod 700 ~/.ssh
找开密钥功能,关闭密码登录
RSAAuthentication yes
PubkeyAuthentication yes
PermitRootLogin yes
PasswordAuthentication no
重启 sshd 服务使配置生效
service sshd restart
下载密钥使用密钥登录
id_rsa