| | |
|
SSH Key Exchange (SSH no password)
I’m not sure if it was just me being a bit dense or the fact that tutorials on the subject where really confusing, but I’d always struggled to get this working. So, I thought that now I’ve cracked it I’ll do my own little tutorial for others out there that may still be a little bit stuck.
- The first thing you have to do is generate the keys, this is done on the machine that will be connecting from:
ssh-keygen -t rsa
This will generate the private and public keys need, they will be put in “~/.ssh/” by default called “id_rsa.pub”(the public key) and “id_rsa” the private key.
- Now you need to copy this public key, “id_rsa.pub”, to the machine you will be connecting to, choose what ever method your comfortable with, ssh, ftp, smb – what ever
- Now all you need to do is add this key to the file “~/.ssh/authorized_keys2″, the easist way is:
cat id_rsa.pub >> ~/.ssh/authorized_keys2
Then your done, you should no longer be prompted for a password when connecting.
Note: if this is the first time you are connecting it will still prompt you to add the machine to known hosts.
This entry was posted
on Thursday, October 30th, 2008 at 5:12 pm and is filed under Out and About, Programing, Shell Script.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
| |
| | |