分类: LINUX
2010-07-23 16:53:46
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:
执行完毕,会在/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开启。
chinaunix网友2010-07-24 22:10:17
请教下,我有一个用户和root有着相同的UID和GID,我怎么使用这个方法来免密码登入?我试过了,比起作用,ssd好像不会读取该用户~/.ssh/authorized_keys里的内容