问题:
[root@server17 ~]# su test
bash-4.2$ ^C
bash-4.2$ exit
描述:
创建普通用户test用户后,切换test,无法正常切换,进入bash-4.2$。搜索了众多帖子,发现原因是可能因为不小心删除了 root 下的 .bash_profile 和 .bashrc 文件或者更多文件所造成的,我们可以从其他用户拷贝这两个文件到 test 目录下即可。
首先查看 test用户下相关文件是否缺失?
[root@server17 test]# l.
. ..
切换到其他正常用户adtest下查看:
[root@server16 adtest]# l.
. .. .bash_history .bash_logout .bash_profile .bashrc .cache .config .mozilla
发现test用户缺失文件,将缺失文件copy过去即可。
[root@server17 ~]# cp /etc/skel/.* /home/test/
cp: 略过目录"/etc/skel/."
cp: 略过目录"/etc/skel/.."
cp: 略过目录"/etc/skel/.mozilla"
您在 /var/spool/mail/root 中有新邮件