Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to automatically apply a terminal profile when connected to a remote machine via SSH?

I'd like more obvious visual cues that I'm connected to a remote machine than the user/host displayed on each terminal line. I spend most of my day connected to multiple machines and it can get confusing.

share|improve this question
What I do now is have separate gnome-terminal launchers for each machine I connect to. Each launcher opens with a different profile and window size. If this could be somehow be made to automagically change when I connect to a server from any terminal it would be awesome. Hope you find a solution. – Ramón Nov 18 '10 at 6:09

3 Answers

up vote 2 down vote accepted

Srigelsford from the Ubuntu forums recommends this:

I created several profiles in gnome-terminal with the settings I wanted, then created aliases like the below example to ssh to ares. The Ares profile has a red background.

alias -p ares='gnome-terminal --window-with-profile=Ares -x bash -c "ssh ares"; exit'

The pitfall of this is that it cannot be done in your existing terminal window, it launches another. My alias closes the existing one after launching the new one, but you can stop that by removing the ; exit from the end.

Just create as many profiles as you like, and associate each server to a profile in an alias. To launch just type the name of the alias $ares

share|improve this answer

i had that on my todolist for quite some time and just tried and searched againg

this is also a reminder to myself: Have to try with screen / byobu

For now i use gnome-terminal profiles . The config files are xml in HOME/.gconf/apps ... and so i might create / copy them via script lateron for some 20 to 50 hosts, with automatically created colors etc. As i write i see and have to admit it is not very sophisticated idea though.

For now i need a easier to type short cut then ALT+D R 0 to open new tab with profile #0 (german shortcut)

share|improve this answer
and add this ubuntuforums.org/member.php?u=536437 – groovehunter Jan 13 '11 at 10:47

You could change the remote system shell profile to use colorfull prompts, check the following link for details: http://www.funtoo.org/en/articles/linux/tips/prompt/ .

share|improve this answer
Thanks. This is an option, but since I connect to a lot of different servers it's a little annoying. Perhaps I could write a script to copy a local settings file. – jeremy Nov 17 '10 at 20:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.