PDA

View Full Version : [ubuntu] Terminal title after ssh



tjay0
May 3rd, 2013, 12:10 PM
Hi guys,
I am looking for a way to change the title of my tabs when i am SSHing into a different server.
I have about 200 servers and i can have about 20 of those open at once.
I was wondering if there was a simple way to automatically change the title of each tab as i ssh to a new server.
ATM i am just right clicking and using the Set title.. option.

Is there a way that i can automate this without editing the .bashrc on every server?

ajgreeny
May 3rd, 2013, 12:48 PM
Are you sure it's not the .bashrc file in the client that needs editing, rather than every server.

I do not know for certain, and am not using SSH at the moment, so I am just throwing this out as a possibility.

tjay0
May 3rd, 2013, 01:13 PM
Well all the solutions i have found through Google are saying you will need to edit .bashrc on the remote server as it will run during initialisation of bash on connection and will run the command to change the title bar.

I need something that will do it from the client side.

prodigy_
May 3rd, 2013, 02:48 PM
http://unix.stackexchange.com/questions/14113/is-it-possible-to-set-gnome-terminals-title-to-userhost-for-whatever-host-i

See the last answer.

tjay0
May 3rd, 2013, 03:27 PM
Thank, but no joy

That script would work but it assumes that the remote server has bash install.
I am remoting to FreeBSD servers and they done all have bash installed.

Plus that script will over write any .bash_profiles you have setup

prodigy_
May 3rd, 2013, 03:34 PM
Then you should switch to Konsole or some other terminal emulator that allows dynamic titles. I don't think it's possible to achieve what you want using Gnome Terminal.

tjay0
May 3rd, 2013, 03:41 PM
Isn't Konsole for the KDE environment though?
Isn't there one for Gnome?

CharlesA
May 3rd, 2013, 03:56 PM
You can use Konsole on Gnome. I much prefer it to the default terminal that comes with Gnome.

prodigy_
May 3rd, 2013, 03:59 PM
Installing Konsole will pull a lot of dependencies but you won't have to change your DE session.

LewisTM
May 4th, 2013, 12:20 AM
You could enable byobu on each server. Then each time you login, you will be taken to a custom screen session with all running tasks waiting for you. By default, byobu displays the login info in the terminal title: user@host (ip.address) - byobu

byobu-enable
Cheers!
242147