步骤如下:
ssh-keygen -t rsa 或 ssh-keygen -d (dsa) => 产生出 id_rsa, id_rsa.pub
scp id_rsa.pub server_hostname:~/.ssh/
ssh server_hostname
cat .ssh/id_rsa.pub >> .ssh/authorized_keys
cat .ssh/id_rsa.pub >> .ssh/authorized_keys2
同时COpy到对方节点。
即可
这样子就可以key认证登入,不需输入密码。