对节点rac1同样:
[root@rac1 ~]# hostname
rac1
[root@rac1 ~]# su - grid
-bash: [: missing `]'
-bash: grid: command not found
[grid@rac1 ~]$ ls -la
total 32
drwx------. 3 grid oinstall 4096 Jul 9 17:51 .
drwxr-xr-x. 4 root root 4096 Jul 9 16:14 ..
-rw-------. 1 grid oinstall 86 Jul 9 17:52 .bash_history
-rw-r--r--. 1 grid oinstall 18 Mar 29 2011 .bash_logout
-rw-r--r--. 1 grid oinstall 390 Jul 9 16:16 .bash_profile
-rw-r--r--. 1 grid oinstall 124 Mar 29 2011 .bashrc
drwxr-xr-x 2 grid oinstall 4096 Jul 9 17:51 .ssh
-rw-------. 1 grid oinstall 645 Jul 9 16:16 .viminfo
[grid@rac1 ~]$ mkdir ~/ .ssh
mkdir: cannot create directory `/home/grid/': File exists
mkdir: cannot create directory `.ssh': File exists
[grid@rac1 ~]$ chmod 700 .ssh
[grid@rac1 ~]$ ls -la
total 32
drwx------. 3 grid oinstall 4096 Jul 9 17:51 .
drwxr-xr-x. 4 root root 4096 Jul 9 16:14 ..
-rw-------. 1 grid oinstall 86 Jul 9 17:52 .bash_history
-rw-r--r--. 1 grid oinstall 18 Mar 29 2011 .bash_logout
-rw-r--r--. 1 grid oinstall 390 Jul 9 16:16 .bash_profile
-rw-r--r--. 1 grid oinstall 124 Mar 29 2011 .bashrc
drwx------ 2 grid oinstall 4096 Jul 9 17:51 .ssh
-rw-------. 1 grid oinstall 645 Jul 9 16:16 .viminfo
[grid@rac1 ~]$ cd .ssh
[grid@rac1 .ssh]$ ls
[grid@rac1 .ssh]$ touch authorized_keys
[grid@rac1 .ssh]$ /usr/bin/ssh-keygen -t dsa
[grid@rac1 .ssh]$ ll
[grid@rac1 .ssh]$ cat id_dsa.pub >> authorized_keys
[grid@rac1 .ssh]$ ssh rac2 cat .ssh/id_dsa.pub >> authorized_keys
The authenticity of host 'rac2 (192.168.1.204)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,192.168.1.204' (RSA) to the list of known hosts.
grid@rac2's password:
[grid@rac1 .ssh]$ scp authorized_keys rac2:~/ .ssh
.ssh: No such file or directory
[grid@rac1 .ssh]$ scp authorized_keys rac2:.ssh
grid@rac2's password:
authorized_keys 100% 1198 1.2KB/s 00:00
[grid@rac1 .ssh]$
[grid@rac1 .ssh]$ ssh rac2 date
Tue Jul 9 10:11:53 EDT 2013
[grid@rac1 .ssh]$ ssh rac1 date
The authenticity of host 'rac1 (192.168.1.203)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac1,192.168.1.203' (RSA) to the list of known hosts.
Tue Jul 9 18:11:56 EDT 2013
登录第二个节点rac2:
[grid@rac2 .ssh]$ ssh rac1 date
The authenticity of host 'rac1 (192.168.1.203)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac1,192.168.1.203' (RSA) to the list of known hosts.
Tue Jul 9 18:11:24 EDT 2013
[grid@rac2 .ssh]$ ssh rac2 date
The authenticity of host 'rac2 (192.168.1.204)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,192.168.1.204' (RSA) to the list of known hosts.
Tue Jul 9 10:12:17 EDT 2013
[grid@rac2 .ssh]$
修改到ORACLE用户,在第二个节点rac2:
[grid@rac2 .ssh]$ su - oracle
Password:
-bash: [: missing `]'
-bash: oracle: command not found
[oracle@rac2 ~]$ mkdir .ssh
[oracle@rac2 ~]$ chmod 700 .ssh
[oracle@rac2 ~]$ touch .ssh/authorized_keys
[oracle@rac2 ~]$ cd .ssh
[oracle@rac2 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
d3:c1:6a:87:6c:07:0e:bf:38:f8:ca:5a:47:b5:f1:d9 oracle@rac2
The key's randomart image is:
+--[ DSA 1024]----+
| |
| . |
| . + o |
| * O + |
| . S * E |
| o + = |
| o + . |
| o o . |
| ..o.. |
+-----------------+
[oracle@rac2 .ssh]$
在第一个节点rac1:
[grid@rac1 .ssh]$ su - oracle
Password:
-bash: [: missing `]'
-bash: oracle: command not found
[oracle@rac1 ~]$ mkdir .ssh
[oracle@rac1 ~]$ chmod 700 .ssh
[oracle@rac1 ~]$ touch .ssh/authorized_keys
[oracle@rac1 ~]$ cd .ssh
[oracle@rac1 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
80:fb:92:23:47:6e:f7:2f:c2:6c:56:6d:f1:ad:c1:3e oracle@rac1
The key's randomart image is:
+--[ DSA 1024]----+
| |
| . |
| . . |
| . . . |
| o S. + . |
| o o . o + . |
| . Boo. . . o |
| + +*.. E |
| o ..o. . |
+-----------------+
[oracle@rac1 .ssh]$ ll
total 8
-rw-r--r-- 1 oracle oinstall 0 Jul 9 18:16 authorized_keys
-rw------- 1 oracle oinstall 668 Jul 9 18:16 id_dsa
-rw-r--r-- 1 oracle oinstall 601 Jul 9 18:16 id_dsa.pub
[oracle@rac1 .ssh]$ cat id_dsa.pub >>authorized_keys
[oracle@rac1 .ssh]$ ssh rac2 cat .ssh/id_dsa.pub >> authorized_keys
The authenticity of host 'rac2 (192.168.1.204)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,192.168.1.204' (RSA) to the list of known hosts.
oracle@rac2's password:
[oracle@rac1 .ssh]$ ll
total 16
-rw-r--r-- 1 oracle oinstall 1202 Jul 9 18:18 authorized_keys
-rw------- 1 oracle oinstall 668 Jul 9 18:16 id_dsa
-rw-r--r-- 1 oracle oinstall 601 Jul 9 18:16 id_dsa.pub
-rw-r--r-- 1 oracle oinstall 400 Jul 9 18:18 known_hosts
[oracle@rac1 .ssh]$ scp authorized_keys rac2:.ssh/
oracle@rac2's password:
authorized_keys 100% 1202 1.2KB/s 00:00
[oracle@rac1 .ssh]$ ssh rac2 date
Tue Jul 9 10:20:07 EDT 2013
[oracle@rac1 .ssh]$ ssh rac1 date
The authenticity of host 'rac1 (192.168.1.203)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac1,192.168.1.203' (RSA) to the list of known hosts.
Tue Jul 9 18:19:57 EDT 2013
登录第二个节点rac2:
[oracle@rac2 .ssh]$ ssh rac1 date
The authenticity of host 'rac1 (192.168.1.203)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac1,192.168.1.203' (RSA) to the list of known hosts.
Tue Jul 9 18:20:39 EDT 2013
[oracle@rac2 .ssh]$ ssh rac2 date
The authenticity of host 'rac2 (192.168.1.204)' can't be established.
RSA key fingerprint is de:71:21:35:46:f1:a4:94:18:ad:d2:54:86:0b:1f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2