1. ssh-keygen -t rsa
2. scp -r /root/.ssh/id_rsa.pub myecs2-ip:/root/.ssh/authorized_keys
如果目标服务器上,已经存在了authorized_keys,那么就将id_rsa.pub中的内容追加到目标服务器的authorized_keys文件中
2.1 cat /root/.ssh/id_rsa.pub | ssh root@myecs2-ip 'cat >> /root/.ssh/authorized_keys'
ssh-免密码登录-2017-8-15
猜你喜欢
转载自ceip2183.iteye.com/blog/2390941
今日推荐
周排行