Tuesday, February 19, 2013

Configure SSH for Oracle Equivalence

SSH connectivity configuration provides connection among nodes without using password :

1) Generate RSA key:
As oracle:cd $HOME (mkdir ~/.ssh if does not exists)
chmod 755 ~/.ssh[oracle@jdb01 ~]$ /usr/bin/ssh-keygen -t rsaGenerating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):                                                   << NO PASSWORD
Enter same passphrase again:                                                                          << NO PASSWORD
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
4f:13:93:db:06:af:f8:c3:fb:6d:ce:cf:b3:bd:bb:91 oracle@jdb
The key's randomart image is:
+--[ RSA 2048]----+
|                           |
|           .               |
|          =               |
|           B              |
|        S + +           |
|         + +    .        |
|        ..o    E         |
|         .o  o.oo      |
|          o+.o+*X   |
+-----------------+

$ pwd
/home/oracle/.ssh
-rw------- 1 oracle dba 1675 Feb 19 11:57 id_rsa-rw-r--r-- 1 oracle dba  397 Feb 19 11:57 id_rsa.pub
-rw-r--r-- 1 oracle dba  404 Feb 19 11:37 known_hosts

2) Generate DSA key:
oracle@jdb01 ~]$ /usr/bin/ssh-keygen -t dsaGenerating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):                                                 << NO PASSWORD
Enter same passphrase again:                                                                        << NO PASSWORD
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:
12:dc:f8:09:43:b1:b5:6d:4f:00:b6:a0:bf:89:c3:18 oracle@jdb
The key's randomart image is:
+--[ DSA 1024]----+
|      +.+..                |
|     + B + .             |
|    . B + o .            |
|     . = o o             |
|  E   o S   .            |
|   + . +                  |
|  . + o                   |
|     .                      |
|                            |
+-----------------+
$ pwd
/home/oracle/.ssh
-rw------- 1 oracle dba  668 Feb 19 12:01 id_dsa-rw-r--r-- 1 oracle dba  605 Feb 19 12:01 id_dsa.pub

Primary or RAC Node1:
cat ~/.ssh/id_rsa.pub >> authorized-keys
cat ~/.ssh/id_dsa.pub >> authorized-keys

scp authorized-keys node2:/home/oracle/.ssh

Stabdby DB or RAC Node2:
Repeate the rsa and dsa ket generation step
create a authorization-keys file and append all keys info

3) Test connection:
ssh  hostname1
or
ssh hostname2


No comments:

Post a Comment