0

I use a specific server for connecting to all servers via SSH. When I connect to the SSH gateway server it perfectly says chronoz@sshgw in the PuTTY title bar and when I connect to a CentOS server this server appears as root@server01. It is very easy to switch between PuTTY windows with the different title bars.

Unfortunately the title bar does not change when I log into debian-servers. It still says chronoz@sshgw, while I am actually logged in into root@debianserver01.

How can I change this? It would greatly enhance my productivity.

ujjain
  • 3,983
  • 16
  • 53
  • 91
  • I found out about this feature today. I have marked 7,8 answers that really helped me as "Accepted". – ujjain Jun 12 '11 at 15:13

1 Answers1

1

It took me quite a while to figure it out, but the answer is as follows.

This is default behaviour on CentOS and not in Debian, because the relevant code has been edited out in the bashrc file located at /etc/bash.bashrc.

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#;;
#*)
#;;
#esac

When commented out this perfectly displays administrator@hostname: ~ in the PuTTY title bar. ~ is the home-folder of the user and will continuously be updated to the current working directory.

administrator@debian: /home   
root@debian: /etc
root@debian: ~ (means you are in /root, your own home-directory)    
ujjain
  • 3,983
  • 16
  • 53
  • 91