登陆服务器
cd vi .bashrc
在尾部加入如下代码
if [ "$SSH_CONNECTION" != '' -a "$TERM" != 'linux' ]; then declare -a HOSTIP HOSTIP=`echo $SSH_CONNECTION |awk '{print $3}'` export PROMPT_COMMAND='echo -ne " 33]0;$HOSTIP:${PWD/#$HOME/~} 07"' fi