1. 程式人生 > >Centos -bash-4.2$

Centos -bash-4.2$

狀況

在這裡插入圖片描述
建立新使用者後切換,命令列開頭沒有正常顯示

原因

筆者在建立使用者的時候指定了一個已存在的資料夾

# useradd -d /home/wyh/ -m wyh

wyh資料夾中缺少了正常使用者目錄的配置檔案

.bash_logout    .bash_profile    .bashrc

解決

# cd /etc/skel/
# cp .bash_logout /home/wyh/
# cp .bash_profile /home/wyh/
# cp .bashrc /home/wyh/

將配置檔案複製到使用者目錄下
重新連線xshell
在這裡插入圖片描述