1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [root@redhat ~]# ssh-keygen -t rsa 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: 4b:70:20:de:89:92:a9:fe:21:a4:9b:7c:6b:65:ae:e0 root@redhat [root@redhat ~]# ls -al .ssh total 20 drwx------ 2 root root 4096 May 10 02:51 . drwxr-x--- 11 root root 4096 May 10 02:51 .. -rw------- 1 root root 1675 May 10 02:51 id_rsa -rw-r--r-- 1 root root 397 May 10 02:51 id_rsa.pub |
1 2 3 4 | [root@redhat ~]# scp /root/.ssh/id_rsa.pub root@192.168.0.4:/tmp [root@redhat .ssh]# ssh 192.168.0.4 root@192.168.0.4's password: ****** [root@server ~]# cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys |
1 | [root@redhat ~]# ssh-agent $SHELL |
1 2 3 4 5 6 | [root@redhat ~]# ssh-add Enter passphrase for /root/.ssh/id_rsa: Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa) Identity added: /root/.ssh/id_dsa (/root/.ssh/id_dsa) [root@redhat ~]# ssh 192.168.0.4 Last login: Sat May 16 11:37:39 2009 from redhat |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |