Generate a key pair with ssh-keygen on Linux

17 July,2010 by Tom Collins

Follow the steps below to generate a key pair with ssh-keygen  on Red Hat Linux
Replace : myserver1 and myserver2 with your server names

#SSH on both members of the cluster – Prepare SSH
/usr/bin/ssh-keygen -f /root/.ssh/id_dsa -q -t dsa -N ""
/usr/bin/ssh-keygen -f /root/.ssh/id_rsa -q -t rsa -N ""

cat /root/.ssh/ >> /root/.ssh/authorized_keys2
cat /root/.ssh/ >> /root/.ssh/authorized_keys2

#On Node 1 (UKRHDB2P02)- in other words -
ssh myserver1 cat /root/.ssh/authorized_keys2 >> /root/.ssh/authorized_keys2

#On Node 2 (UKASDB2P02)- in other words -
ssh myserver2 cat /root/.ssh/authorized_keys2 >> /root/.ssh/authorized_keys2

ssh <the other server> uname -a

 Ref:Jack Vamvas(


Author: Rambler(


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on Generate a key pair with ssh-keygen on Linux

Comments are moderated, and will not appear until the author has approved them. | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright