SSH实现基于秘钥连接的部署步骤
- 管理端创建秘钥对信息
[root@zun ~]# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
- 管理端需要将公钥进行分发
[root@zun ~]# ssh-copy-id -i /root/.ssh/id_dsa.pub root@172.16.1.10
- 进行远程连接测试
[root@zun ~]# ssh 172.16.1.10 --- 不用输入密码信息可以直接连接