Green

SSH Keys, SSH-Agent and Keychain

This is just another version of a host of other HowTo’s on this subject. It’s just this one is specific to me, so I’m really posting it for me. I posted the original version of this on the work wiki, so that might explain why it reads like it does. A bit. Maybe.

First create a DSA key on your primary development machine, in this case mars, 5 or more random words strung together, alphanumeric, you know the drill, (just to emphasise, this is a passphrase, not a password, it’s meant to be longer) :

ssh-keygen -t dsa

Then copy the generated public key to the machine you’re logging onto, in this case earth:

scp .ssh/id_dsa.pub USERNAME@earth:

SSH to earth:

ssh stephen@earth

On earth, add the public key to the list of authorized keys:

cat id_dsa.pub >> .ssh/authorized_keys

Exit earth, return to mars.

In your home dir on /mars/ edit ~/.bash_profile


# on this next line, we start keychain and point
# it to the private keys that we'd like it to
# cache

/usr/bin/keychain --clear id_dsa
. ~/.keychain/$HOSTNAME-sh

Exit mars and log in again. Now Keychain should start an ssh-agent session which, once you’ve typed in the passphrase, will cache your DSA keys meaning for the duration of this session you don’t have to enter a password/passphrase when connecting to earth. You can do the same thing for all of the machines you connect to as well, which is groovy, as someone might say.

«0 CommentsApril 25, MMVI»


Name:

Email:

URL (optional):

What colour is an orange?:

Comment (comments use Textile formatting):

About This

You've arrived at the homepage of Stephen Stewart. The archive is available here for those who want it. This site is happily hosted by Dreamhost. Click for more?

More!? OK then, but I can't help feeling that this will be a disappointment to you.
I work as a web designer in Belfast, and I live by the sea in a shoe. You can see me here, doing my livejournal pose as idoru called it. If you need to you can email me at carisenda -at- gmail -dot- com.

My hCard

Stephen Stewart
Donaghadee , County Down Northern Ireland

Recent Comments


Recommended Viewing

  • 300rating
    Does exactly what it says on the (comic book) tin. Loved it.
  • Little Miss Sunshinerating
    Very funny, disturbing (the beauty pageant) and completely messed up -- but in a good way.
  • Laputa: Castle in the Skyrating
    Story great, characterization a little on the weak side -- though the big robots are cool.
  • Porco Rossorating
    Stylish, funny, exciting.
  • Grave of the Firefliesrating
    Very sad, which was a little unexpected since I didn't know much about it before watching it. Can be a little too slow in places though, otherwise it's very good.
  • Nausicaä of the Valley of the Windrating
    The story can get a little dense at times what with the various factions, but still really enjoyable, inventive and engaging.
  • X-Men: The Last Standrating
    Opportunity, talent, money - all blown. Over 3 films X-Men has hinted of something great that could have been, this last one says "No, sorry - not going to happen". Bah.

flickr.com


Main Atom Feed, Photoblog Atom Feed, Linkblog Atom Feed, Technorati Profile
Powered by Movable Type 3.34. Design © Stephen Stewart. Happily hosted by Dreamhost.