ssh远程主机的免密登录配置
ssh经常登录远程主机,需要输入密码,很麻烦,怎样变懒呢?
test environment:
hostA:ubuntu14.04 username:frank ip:192.168.1.109
hostB:ubuntu12.04 username:frank ip:192.168.1.107
1.hostA ssh-keygen 生成公钥
cd ~
ssh-keygen -t rsa
2.copy hostA的公钥到 hostB:frank
scp /home/frank/.ssh/id_rsa.pub frank@192.168.1.107:/home/frank/.ssh/authorized_keys
3.login hostB in hostA,(first time, you need to input hostB's passward)