Monday, July 6, 2009

Re: [BLUG] ssh and screen

For those unaware of it.

I have a laptop with two user accounts. One for work. One for play.

Sometimes I need to SSH in to work after-hours, but I'm logged in to
my play account. I know it won't be for long, I just need to check
something out.

I don't have the same SSH keys available via both accounts. They have
different SSH keys, and my play one can't connect in to my work boxes.

ssh $OTHERUSER@localhost
ssh-agent screen

My laptop is configured to block SSH connections from the network, but
it has SSH running locally with PAM-based passwords. (I've taken to
doing this as some applications complain about the controlling PTY not
belonging to the UID if I just do a "su $OTHERUSER -". In this context I
think either method should work just as well.)

ssh-agent allows you to specify a program to launch. If you specify a
program, it will automatically quit when that application dies. This
means you can have it start screen, get all the benefits of an SSH agent
within all the screen windows, and when you're done it automatically
disappears.

Very handy.

Cheers,

--
Steven Black <blacks@indiana.edu> / KeyID: 8596FA8E
Fingerprint: 108C 089C EFA4 832C BF07 78C2 DE71 5433 8596 FA8E

No comments: