[clue-tech] Question for script wizards

David L. Anselmi anselmi at anselmi.us
Fri Apr 10 00:08:22 MDT 2009


Sean LeBlanc wrote:
> I think I may have found what I need to do, although I haven't done it yet.
> Apparently, ssh (usually according to man page) sets some vars. One of which
> is SSH_CONNECTION.

This is the way to tell where you came from.

Rather than trying a fancy script to guess what you want run, I would 
just specify it:

ssh foo /bin/bash -i

gets you what you want, right?  If you can't change the user's profile 
then make your own and do:

ssh foo /bin/bash --rcfile ~/.bar -i

(pay attention to where the ~ gets expanded, and try to make the file 
something others won't stomp on).

Where I work I use ssh to get into a shared account.  I haven't done 
this yet because I usually need the shared environment when doing things 
as that user.

But I have put my ssh key in the authorized_keys file.  Then (using the 
ssh agent) I can ssh in from my account without a password.  So if you 
really don't want to specify your settings on the client end, you can 
specify them in the authorized_keys file for your key.  Maybe a little 
easier than the environment variable passing Jacob suggested.

Dave


More information about the clue-tech mailing list