Home » Configure SSH Keys authentication connectivity in Oracle Linux

Configure SSH Keys authentication connectivity in Oracle Linux

by tuanlp

Configure SSH keys connectivity for RAC Environment Oracle

  1. Install the yum package. (Run on both nodes)
yum install openssh-server
  1. Start the SSH service. (Run on both nodes)
service sshd start

  1. Configure SSH for start on reboot.(Run on both nodes)
chkconfig sshd on
  1. Enable 22 port from firewall or disable firewall settings. (Run on both nodes)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

Or

systemctl stop firewalld
systemctl disable firewalld
  1. Run this command to generate key in .ssh hidden folder at home location. (Run on both nodes)
su - oracle
mkdir ~/.ssh
chmod 700 ~/.ssh
/usr/bin/ssh-keygen -t rsa
  1. Two files are created as RSA public key id_rsa.pub file and the private key id_rsa file.

  2. Copy the public key into authorization key.

cat id_rsa.pub >> authorized_keys
  1. copy these authorized_keys file to node 2 with scp command.
scp authorized_keys rac2.localdomain:/home/oracle/.ssh/
  1. Put the other node id_rsa.pub in authorized_keys file and scp back to node 1.
cat id_rsa.pub >> authorized_keys
scp authorized_keys rac1.localdomain:/home/oracle/.ssh/
  1. Test the authorized_keys file.

Note: first time it will ask for yes then type YES. From next time it will not prompt.

ssh rac1 date
ssh rac2 date
ssh rac1.localdomain date
ssh rac2.localdomain date

You may also like