[clug] ssh to box, run shell command, then leave shell open?

Angus Gratton gus at projectgus.com
Fri Apr 15 00:04:30 MDT 2011


On Fri, 2011-04-15 at 15:46 +1000, Carlo Hamalainen wrote:
> Since various people work on this account, I'd need the remote box's
> bash_profile identify that it is indeed me logging in via ssh. Is that
> possible?

You can get your client machine's IP address from the first field in
$SSH_CLIENT, is that always the same?

If not, you could put a SendEnv in your ssh_config file to pass a
particular custom environment variable (that you export from your own
profile), and then check for that in .bash_profile on the server, I
guess.

- Angus



More information about the linux mailing list