1.以root用户登录 2.vi /etc/profile 3.添加 export PS1='[\u@\h \w]' 其中\u显示当前用户账户, \h显示当前主机名, \w显示当前路径 4.source /etc/profile