1 Answer
1

One way to solve this is to configure prompt on your computer(s) so that it looks different, in a way specific to that machine. For example, you can assign a color to each machine and use that color for the host part of the prompt. (How to do that is another question.)

When you start an ssh session, your local terminal will be receiving the color codes along with prompt, so (as long as your prompt is configured correctly) you do not have to do anything special to revert it back.

Then using any terminal emulator that supports colors should result in correct coloring.

I use this approach quite frequently with PuTTY and several remote machines (all Debian). Even sshing from one session to other (i.e., connecting via PuTTY to machine A and issuing ssh B) works perfectly.

However, the pitfall is that not all terminals will support colors correctly, but from your question I can't see how big deal is it for you.

This is correct, the remote systems are where the terminal colors are defined, was just going to answer, but you beat me to it. So, he just needs to make each system (including local) unique.
–
skubJan 18 '12 at 19:04

@Sion By setting PS1 in .bashrc, But that's really a different question (actually one that has been asked and answered countless times). Google is your friend. And [} superuser too. .-)
–
Alois MahdalJan 18 '12 at 19:31

@Alois Mahdal Yeah. I thought it would be but I also thought that seemed important information to attach to this question for archival sake.
–
SionJan 19 '12 at 6:21

The problem with this approach is that I access several different servers through ssh (not at the same network). I would prefer to have the terminal colors set at the moment of connection. Anyway, I will be copying my configuration to the servers on demand. Thank you.
–
EduJan 20 '12 at 12:59