You can send along environment variables from your local machine using SSH.
For example, put export FOO_USER="$USER"
(in tcsh
's version of .bash_profile
) or FOO_USER=joe ssh remote-host
(on the command line) on your local machine. Edit your ~/.ssh/config
to include this: SendEnv LANG LC_* FOO_USER
.
Then, on the remote server, you can check for that variable in the .bash_profile
(or what have you in tcsh
), and perform the appropriate action:
if [ "$FOO_USER" = 'joe' ]; then
export PS1='--[ Joe rules ]-- \u@\h \w \$ ';
source tcsh.joe;
elif [ "$FOO_USER" = 'jane' ]';]; then
alias ll='ls -Al';
fi
By default, the SSH server only accepts LANG
and LC_*
, so if you cannot edit /etc/ssh/sshd_config
on the server to add AccceptEnv LANG LC_* FOO_USER
, you could hack around it by abusing the LC_*
variables, e.g. LC_FOO_USER=joe
. Update your .bash_profile
s (or rather, the appropriate local and remote tcsh
files) accordingly.