postimg
Dec 2009 22

SSH Key Sharing0

Posted In Networking By John Hass

SSH allows you to do key sharing which allows you to log into a machine without typing your password, or even for that matter, having a password at all. Best of all, it does the key sharing completely encrypted, so the chance of you losing your keys in the process is very unlikely.

In my example I have 2 machines. A desktop and server.  I want to be able to connect to server without entering my password.

On Desktop (there is no need to be root)

ssh-keygen -b 2048 -t rsa

A message will prompt you for the location: leave it the default.
The next menu will ask you for a pass phrase: leave it blank.
Leave the next pass phrase blank as well.

Your keys will now be generated in ~/.ssh
you can “cd ~/.ssh”
type “cat id_rsa.pub”
You will now see your public key this is the key you share with everyone. The other is your private you share this with no one.

The next step is to get your key over to server

scp id_rsa.pub username@server:~/username_id_rsa.pub

Then you must put the info in ~/.ssh/authorized_keys2

ssh username@server "cat ~/username_id_rsa.pub >> ~/.ssh/authorized_keys2"

You will now be able to ssh to server without entering your password.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • email
  • LinkedIn
  • MySpace
  • PDF
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Leave a comment

Get Adobe Flash playerPlugin by wpburn.com wordpress themes