Monday, September 3, 2007

Configuring SSH

Configure SSH between two nodes

While logged in as oracle perform the following on each of the nodes of the RAC:

  1. cd $HOME
  2. mkdir ~/.ssh
  3. chmod 700 ~/.ssh
  4. /usr/bin/ssh-keygen -t rsa
  5. /usr/bin/ssh-keygen -t dsa

On Node 1:

  1. cd $HOME/.ssh
  2. cat id_rsa.pub >> authorized_keys
  3. cat id_dsa.pub >> authorized_keys
  4. Copy the authorized_keys file to the node 2. scp authorized_keys node2:/opt/oracle/.ssh

On Node 2:

  1. cd $HOME/.ssh
  2. cat id_rsa.pub >> authorized_keys
  3. cat id_dsa.pub >> authorized_keys
  4. scp authorized_keys node1:/opt/oracle/.ssh

  • Now perform a ssh between all the nodes including the node-priv hostnames as well. Check to make sure that ssh is configured well without prompting for the password (on both the nodes):
$ ssh coke.pinnacle.com date
Sun Aug 12 08:41:42 CDT 2007
$ ssh pepsi.pinnacle.com date
Sun Aug 12 08:42:23 CDT 2007
$ ssh coke-priv date
Sun Aug 12 08:42:45 CDT 2007
$ ssh pepsi-priv date
Sun Aug 12 08:43:22 CDT 2007

3 comments:

Eder Papai said...

Very good.
Please, you can reply my post on the oracle forum?
The post is RAC 10g AIXL 5.3without HACMP/GPFS
Eder

Surachart Opun said...

good

Unknown said...

The instructions leave out a step:

on each node do the following

cat id_rsa.pub >> authorized_keys.NODE_NUMBER
cat id_dsa.pub >> authorized_keys.NODE_NUMBER

the scp the authorized_keys.NODE_NUMBER files to each of the other systems

THEN

combine all the authorized_keys.NODE_NUMBER files into a single authorized_keys on each system,

for example

on node one of a three node rac, you would type the following after copying the files to each of the
other systems:

cat authorized_keys.1 >> authorized_keys
cat authorized_keys.2 >> authorized_keys
cat authorized_keys.3 >> authorized_keys

ALWAYS remember to copy the one created on the node itself as well.