Step 1) $ ssh root@192.168.1.1

The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.1.1' (RSA) to the list of known hosts.
root@192.168.1.1's password: [輸入密碼]

Last login: Thu Jun 28 13:24:18 2012 from Nagios-srv
[root@192.168.1.1 ~]# exit

 

Step 2) $ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.1

21
root@192.168.1.1's password: [輸入密碼]

Now try logging into the machine, with "ssh 'root@192.168.1.1'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.

 

Step 3) $ ssh-keygen -t dsa

Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): [Enter]
Enter passphrase (empty for no passphrase): [Enter]
Enter same passphrase again: [Enter]
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
οο:οο:οο:οο:οο:οο:οο:οο:οο:οο:οο:οο:οο:οο:οο:οο root@Nagios-srv

 

Step 4) $ ssh root@192.168.1.1

Last login: Fri Jun 29 14:39:50 2012 from Nagios-srv
[root@192.168.1.1 ~]#

 

Step 5) 大功告成。

dreamtails 發表在 痞客邦 PIXNET 留言(0) 人氣()