场景:
需要从主机1.100免密码多了到1.115及1.116
实现:
登陆1.100
$ cd ~/.ssh/
$ ssh-keygen -t rsa 然后三个回车
会有两个文件产生,id_rsa 私钥 id_rsa.pub 公钥
$ scp id_rsa.pub user1@1.115:~/.ssh/
$scp id_ras.pub user2@1.116:~/.ssh/
user1登陆1.115
$ cd ~/.ssh
$ cat id_rsa.pub >> authorized_keys
user2登陆1.116
$ cd ~/.ssh
$ cat id_rsa.pub >> authorized_keys
再登陆1.100 尝试是否成功
ssh user1@1.115
ssh user2@1.116