Setup SSH RSA Key

 

Setup Source Machine

* Login the source machine and cd to home directory
* Make a directory named .ssh if it does not exist already
* Create RSA key
* Copy public key to destination machine. You can use scp or copy and paste.

mkdir ~/.ssh
chmod 700 ~/.ssh
cd ~/.ssh
ssh-keygen -t rsa
scp .ssh/id_rsa.pub myid@targetsvr:~/.ssh

Setup Target Machine

* Login the target machine and cd to home directory
* Make a directory named .ssh if it does not exist already
* Append text from id_rsa.pub to authorized_keys2
* Set file permission on authorized_keys2

mkdir ~/.ssh
chmod 700 ~/.ssh
cd ~/.ssh
cat id_rsa.pub >> authorized_keys2
chmod 600 authorized_keys2

Test

* Back to source machine
* Test ssh without password:

ssh -l myid 10.10.1.10
scp myid@10.10.1.10:/tmp/*.zip /tmp
This entry was posted in Linux and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.