2012年(101)
分类: LINUX
2012-06-12 21:07:14
[root@t_rac_one:/app/oracle11g]# su - grid
[grid@t_rac_one:~]# /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_rsa):
Created directory '/home/grid/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_rsa.
Your public key has been saved in /home/grid/.ssh/id_rsa.pub.
The key fingerprint is:
34:7e:94:d4:fa:2f:1e:99:15:a5:8c:34:db:6e:a8:e9 grid@t_rac_one
[grid@t_rac_one:~]# /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/grid/.ssh/id_dsa.
Your public key has been saved in /home/grid/.ssh/id_dsa.pub.
The key fingerprint is:
6b:ed:9d:56:96:fa:71:ab:12:4f:36:39:ed:3a:49:70 grid@t_rac_one
以上操作各节点都需执行.
[grid@t_rac_one:~]# ssh t_rac_one cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
The authenticity of host 't_rac_one (10.1.112.193)' can't be established.
RSA key fingerprint is 28:0c:5f:b0:3b:1a:8d:50:62:47:8d:d1:a7:bd:7a:03.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 't_rac_one,10.1.112.193' (RSA) to the list of known hosts.
Password:
[grid@t_rac_one:~]#
[grid@t_rac_one:~]# ssh t_rac_two cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
The authenticity of host 't_rac_two (10.1.112.194)' can't be established.
RSA key fingerprint is 28:0c:5f:b0:3b:1a:8d:50:62:47:8d:d1:a7:bd:7a:03.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 't_rac_two,10.1.112.194' (RSA) to the list of known hosts.
Password:
分发公共密钥到各节点:
[grid@t_rac_one:~]# scp ~/.ssh/authorized_keys t_rac_one:.ssh/authorized_keys
authorized_keys 100% 792 0.8KB/s 00:00
[grid@t_rac_one:~]# scp ~/.ssh/authorized_keys t_rac_two:.ssh/authorized_keys
Password:
authorized_keys 100% 792 0.8KB/s 00:00
[grid@t_rac_one:~]# ssh t_rac_two