Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am connecting with putty to a stock Ubuntu machine hosted at EC2, and notice the following:

When I connect, the title of the putty window appears at first as the hostname I enter (e.g. ""). After it's connected, the hostname changes to a different string - user@domU-12-31-20-0a-81-AB: ~ (different on each machine).

This look like an ethernet address of sort, I'm not sure. It's really annoying because once I open 2-3 putty consoles I can't remember which is which.

Is it possible a ~/.bashrc script run from the machine itself changes the putty title? Somewhere else I should look into?


I forgot to mention this ... but I have tried this and the title I set up in the connection is shown briefly when connecting, but then overriden just like the default hostname title.

share|improve this question
Deleted my answer, please update with that info :D – nerdwaller Nov 26 '12 at 18:31
up vote 7 down vote accepted

It's most likely updated by your shell prompt ($PS1 in ~/.bashrc or the system-wide /etc/bash.bashrc). Look for \e]2; or \033]2; or a similar escape sequence.

Your given example looks like the usual "<user>@<host>:<path>" template, in which domU-12-31-20-0a-81-AB is the server's hostname as currently configured in the kernel. Most likely, it was assigned by an automated Xen domU creation tool based on your virtual server's Ethernet address.

You can change the current hostname by using hostname newname. To make it persist across reboots, look around in /etc – on every reboot, the hostname is read from the file /etc/hostname (other distributions may use /etc/sysconfig/hostname or similar).

share|improve this answer
It is my shell's prompt - but when I edit it later on using PS1=myprompt it doesn't stick. It seems editing the prompt inside .bashrc affects the putty title. – ripper234 Nov 26 '12 at 20:34

The easier answer to this question is two configuration changes in your Putty preferences for the session(s):

  1. In Window -> Behaviour set your desired Window title.

  2. In Terminal -> Features check Disable remote-controlled window title changing.

share|improve this answer

Nothing new to what grawity already said but a lot more detailed/mind-blowing article here:

Relevant section for title manipulation is:

share|improve this answer

An exert from the /etc/bash.bashrc file is to run the following line to fix your title back to the default:

echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"
share|improve this answer

You can change the title in putty (under linux) with this command:

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

in this case, it will display your USER name, your HOSTNAME and it wil Print out your current Working Directory

or you can do this, with a string of your choosing:

xterm -T "Title of My xterm" -n "Title when minimized"
share|improve this answer

For CentOS and RedHat Linux you can create an empty file:

touch /etc/sysconfig/bash-prompt-xterm

And change its permissions with:

chmod 555 /etc/sysconfig/bash-prompt-xterm

Then /ect/bashrc won't change your PuTTY title, which you can set in PuTTY's settings:

Window -> Behaviour -> Window title
share|improve this answer

Your Answer


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.