1,生成密钥



2,在ssh服务器上安装密钥
~/.ssh/authorized_keys #没有的新建就好了,把生成的密钥复制到这里面
3,设置权限
[root@ecs-326c-0001 .ssh]# chmod 600 authorized_keys [root@ecs-326c-0001 .ssh]# chmod 700 ~/.ssh
4,开启密钥登录
编辑vi /etc/ssh/sshd_config
RSAAuthentication yes PubkeyAuthentication yes
5,重启
systemctl restart sshd
https://blog.csdn.net/my_csdn_lsq/article/details/115899341