打开 /root/.bashrc 在文件中追加以下内容
if [ "$SSH_CONNECTION" != '' -a "$TERM" != 'linux' ]; then
declare -a HOSTIP
HOSTIP=echo $SSH_CONNECTION |awk '{print $3}'
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${ HOSTIP }:[${HOSTNAME%%.*}]:${PWD/#$HOME/~} \007"'
fi