Actually, you can make ssh send environment variables over to the server, so they are available in the remote session. Here's how you do it (example for file type colors, but you can adapt it for other environment variables too):
In your ~/.ssh/config
(current user) or /etc/ssh/ssh_config
(all users) add these lines:
Host *
SendEnv LS_COLORS
In remote server's /etc/ssh/sshd_config add this line if it does not exist:
AcceptEnv LS_COLORS
Note: You may need to modify the existing AcceptEnv line to just add LS_COLORS to it.
- Restart ssh server.
That's it! Now, your ssh session will inherit ls colors from your current shell.
Caveats:
- That this won't work with aliases, just with environment variables.
- Works for ssh protocol 2 only.
- Your remote shell may overwrite what's being sent via remote .bashrc