标签:无密码登陆 scp mod ima art save auth nbsp print
1.在master机器上生成公钥:
[root@master ~]# ssh-keygen -t rsa 注:一直按enter键就可以生成了
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory ‘/root/.ssh‘.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
81:39:eb:23:2c:f9:75:af:93:cb:76:00:87:3e:cf:0f root@master
The key‘s randomart image is:
+--[ RSA 2048]----+
| |
| o |
| +.. |
| oo.. |
| ..oS |
| o .o . |
| o o ++Eo |
| o o +*o. |
| . .+*o |
+-----------------+
2..执行 cp id_rsa.pub authorized_keys
3.把master上面的authorized_keys文件复制到Slave机器上
scp authorized_keys slave:~/.ssh
4..slave1上的修改.ssh目录的权限以及authorized_keys 的权限(这个必须修改,要不然还是需要密码)
标签:无密码登陆 scp mod ima art save auth nbsp print
原文地址:http://www.cnblogs.com/code4app/p/7415294.html