模拟机器有两台
主机名:
centos
yuanhe
1. 生成私钥id_dsa和公钥id_dsa.pub
ssh-keygen -t rsa
每次系统提示信息,按回车就行
2. 将该密钥用作认证,进行访问授权。
cp ~/.ssh/id-dsa.pub ~/.ssh/authorized_keys
3.将~/.ssh下的文件复制到其他节点
scp -r ~/.ssh/* he@yuanhe:/home/he/.ssh
4.检查是否成功
ssh yuanhe
遇到的问题
Agent admitted failure to sign using the key.
输入ssh-add可以解决。