SSH通过密钥连接
ssh -i ~/miyao.pem root@server_ip
密钥权限要设置为仅root用户读写
chmod 600 ~/miyao.pem
密钥可添加到系统里,以后连接可除去 -i 选项
#添加下面这行即可 多个密钥添加多行 IdentityFile ~/miyao.pem
/etc/ssh/ssh_config
Linux ssh 密钥对登陆设置
原文:https://www.cnblogs.com/saopanda/p/10900842.html