1.生成秘钥对
ssh-keygen -t rsa
2.拷贝公钥到免密服务器
ssh-copy-id -i .ssh/id_rsa.pub root@要登陆的主机IP
注:如果提示ssh-copy-id command not found可以执行如下命令:
cat ~/.ssh/id_rsa.pub | ssh root@IP 'cat >> .ssh/authorized_keys'
1.生成秘钥对
ssh-keygen -t rsa
2.拷贝公钥到免密服务器
ssh-copy-id -i .ssh/id_rsa.pub root@要登陆的主机IP
注:如果提示ssh-copy-id command not found可以执行如下命令:
cat ~/.ssh/id_rsa.pub | ssh root@IP 'cat >> .ssh/authorized_keys'