Search This Blog

Total Pageviews

Saturday 3 June 2017

Oracle Rac setup ssh key

Oracle Rac setup ssh key ..

setup ssh key

 Host detail !!
orarac12a  192.168.0.41
orarac12b  192.168.0.45


Imp!!!!
make a .ssh directory under user home directory on all nodes

mkdir ~/.ssh
chmod 700 ~/.ssh
cd ~/.ssh


[grid@orarac12a ~]$ mkdir ~/.ssh
[grid@orarac12a ~]$ chmod 700 ~/.ssh
[grid@orarac12a ~]$ cd ~/.ssh

command ssh-keygen -N '' -t rsa initiated the creation of the key pair without any password. private key will be  saved in .ssh/id_rsa. 

[grid@orarac12a .ssh]$ ssh-keygen -t rsa -N '' -f id_rsa
Generating public/private rsa key pair.
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
6b:86:bf:f3:88:7b:7e:5c:fb:19:61:bd:34:ab:e0:98 grid@orarac12a
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|               . |
|        S     oo.|
|       . .  ....+|
|      . +. o ..o |
|       =o.* o .o |
|      o+=E.. oo  |
+-----------------+

to  append the authorized keys

[grid@orarac12a .ssh]$ cat id_rsa.pub > authorized_keys

[grid@orarac12a .ssh]$ ls -ltr
total 12
-rw-r--r--. 1 grid oinstall  396 Jun  3 10:07 id_rsa.pub
-rw-------. 1 grid oinstall 1675 Jun  3 10:07 id_rsa
-rw-r--r--. 1 grid oinstall  396 Jun  3 10:07 authorized_keys

[grid@orarac12a .ssh]$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIdWRKqwbanBGpx1KJUSdN/T4ozvyBfmSU/WC5HaiHgHRXRDfQ8S6pd02j/2MzmQ7LH7BhLefcRiiaeqd6+DxOOqVDGQ0iciVEYyjqenlgnVSVy1fgMda85XTFP5H0xFiiAS+gJq7CxTr57ixrCRLsjpLNUkr8Kc45lI52l9kBHBl+1zAqliImVYj96+fbx96xwkpj2x2AltNlXyzg7v+Mv3jJM4Fs9BoDmPusYQvP4rFYS70GmuQtwCztoiHjMK7RoQ2rt8KFv+W0zdlpuKOh/d6/ec4HrJwLhXrrSd4ivgjLhej3XmRtAUB2pwGatEi0wmJG6heD7QcqVWiCHN3l grid@orarac12a


######################################################################################
Repeat this action for every node in the the cluster, until you've added the last node  
######################################################################################

To copy the key to other node 

[grid@orarac12a .ssh]$ ssh-copy-id grid@192.168.0.45
The authenticity of host '192.168.0.45 (192.168.0.45)' can't be established.
ECDSA key fingerprint is b4:c0:5d:61:87:5b:f9:15:a8:c3:61:ba:f6:13:87:03.
Are you sure you want to continue connecting (yes/no)? yes
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
grid@192.168.0.45's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'grid@192.168.0.45'"
and check to make sure that only the key(s) you wanted were added.

[grid@orarac12a .ssh]$ ls -ltr
total 16
-rw-r--r--. 1 grid oinstall  396 Jun  3 10:07 id_rsa.pub
-rw-------. 1 grid oinstall 1675 Jun  3 10:07 id_rsa
-rw-r--r--. 1 grid oinstall  174 Jun  3 10:10 known_hosts
-rw-r--r--. 1 grid oinstall  792 Jun  3 10:10 authorized_keys


and from other node 

ssh-copy-id grid@192.168.0.41


[grid@orarac12a .ssh]$ ssh 192.168.0.45
Last login: Sat Jun  3 10:04:52 2017

Oracle DBA

anuj blog Archive