用户登录环境变量故障

登录系统后,命令行出现如下提示:为什么?
[root@oldboyedu /home/chenglong1]# su - chenglong1
-sh-4.2$
-sh-4.2$
解答:用户的环境变量缺失导致的。
执行如下命令解决
-sh-4.2$ cp /etc/skel/.bash* .
-sh-4.2$ source ./.bash_profile ./.bashrc
[chenglong1@oldboyedu ~]$
[chenglong1@oldboyedu ~]$

-sh-4.2$ export PS1='[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\]\[\e[31;1m\] \w\[\e[0m\]]\$'
[chenglong1@oldboyedu ~]$

posted @ 2020-01-14 20:21  陶清刚  阅读(64)  评论(0)    收藏  举报