Take the 2-minute tour ×

I've got a bunch of good stuff in my bash config. Normally when I get a new account, I pull this down from my GitHub repo so that I have all the aliases and features I'm used to. There are some hosts that I access which I don't have my own accounts on, but shared accounts that a bunch of people use, so it would be rude of me to install my shell config.

Is there a way to push my shell config, or at least some initialization commands, over the SSH session so that I have the environment I'm used to?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted


           eval \"$SSH_ORIGINAL_COMMAND\";
         else exec \"$SHELL\"; fi" ssh-rsa AAAA…== drew@example.com


Then put your favorite configuration files in that .HOME.drew directory.




share|improve this answer
Oh, I'm totally with you on the grumbling! –  Drew Stephens Jun 9 '11 at 18:57
add comment

I like to keep a file .bsa somewhere convenient (maybe ~ will work in this case) so I can just . ~/.bsa to get my environment.

share|improve this answer
add comment

Maybe try to hack something together with "LocalCommand" (see man ssh_config)?

share|improve this answer
That permits running something on the local machine. How would that help? –  Gilles Jun 9 '11 at 18:52
By using that as a trigger to launch a script on the local machine (which seems to be his starting point in each case) that will copy over whatever he needs to the target. –  Some Guy Jun 9 '11 at 18:54
add comment

Your Answer


