ssh-免密码登录-2017-8-15

1.ssh-keygen-trsa

2.scp-r/root/.ssh/id_rsa.pubmyecs2-ip:/root/.ssh/authorized_keys

如果目标服务器上,已经存在了authorized_keys,那么就将id_rsa.pub中的内容追加到目标服务器的authorized_keys文件中

2.1cat/root/.ssh/id_rsa.pub|sshroot@myecs2-ip'cat>>/root/.ssh/authorized_keys'

相关推荐