Set the Ubuntu environment variable to control the title of the Putty window! This time is over ~ Turn off the wrong server, and: (this mistake is often made because N or more Putty remote connections are opened on the desktop, and they all look like one, so they will be wrong if they are not careful! Is there any good way for me to better distinguish them? The following provides a good solution (the Putty tool is executed in the following scenarios, and the root user is remotely logged on. The SSH host is Ubuntu Server) ● use the cd command without any parameters to enter ~ Directory ● Due to Ubuntu Server 13 ~ /There is no. bash_profile. First use touch. bash_profile to create a brand new ● use vi to edit it. Enter the following content ----------------------------------- #. bash_profile # Get the aliases and functions if [-f ~ /. Bashrc]; then .~ /. Bashrc fi # User specific environment and startupprograms # PATH = $ PATH: $ HOME/bin # export PATH # add following statement to the END offile ~ /. Bash_profile # auto add env parameter $ PROMPT_COMMANDwhen use non-Linux tty login by ssh. if ["$ SSH_CONNECTION "! = '']; Then export HOSTIP = 'echo $ SSH_CONNECTION | awk '{print $3}' | awk-F: '{if ($1 = "") print $4; else print $1} ''export PROMPT_COMMAND = 'echo-ne" \ 033] 0; $ {USER} @ '$ hostip ': [$ {HOSTNAME %. *}]: $ {PWD/# $ HOME /~} \ 007 "'env | grep PROMPT_COMMAND # Set the DISPLAY env var for Xmanagerforward # export DISPLAY = 'echo $ SSH_CONNECTION | awk '{print $1}' | awk-F: '{if ($1 = "") print $4; else print $1 }'': 0.0 fi --------------------------------------- ● the first two sentences of the above script will execute scripts for setting environment parameters ~ /. Bashrc. After research, because some parameters of the script set by default in Ubuntu will conflict with the expected effect, we need to edit and block part of the content. Edit with vi ~ /. Bashrc shields the following two sections of code from comments (adds the annotator # to the beginning of the first line) ------------------------------------- the first section: # set a fancy prompt (non-color, unless weknow we "want" color) case "$ TERM" in xterm-color) color_prompt = yes; esac ---- post-annotation ------- # case "$ TERM" in # xterm-color) color_prompt = yes; # esac Section 2: # If this is an xterm set the title touser @ host: dir case "$ TERM" in xterm * | rxvt *) PS1 = "\ [\ e] 0; $ {debian_chroot: + ($ debia N_chroot)} \ u @ \ h: \ w \ a \] $ PS1 ";;*);; esac --------------------------------------- enjoy is automatically displayed upon logon after configuration is complete !! :)