A机中SSH免密码登录B机
时间:2010-07-23 来源:superzgc
SSH免密码登录
例:A机登录B机
1.在A机中
#ssh-keygen –t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <---直接按enter
Enter same passphrase again: <---直接按enter
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:
e8:8a:5e:ae:c7:13:45:d0:81:cd:3f:e6:1e:f8:88:5a [email protected]
执行完毕,会在/root/.ssh/下面生成id_rsa.pub
2.在B机中创建/root/.ssh/authorized_keys,将A机id_rsa.pub中的内容,拷贝到B机/root/.ssh/authorized_keys中
3.在B机中,将/etc/ssh/sshd_config中的PermitRootLogin yes开启。
4.B机中#service sshd restart









