1. 程式人生 > >Ubuntu 增加新使用者

Ubuntu 增加新使用者

1:新增使用者
useradd user1
passwd user1
2:建立使用者目錄
usermod –d /users/us1 user1
3:更改使用者資料夾歸屬屬性
chown -R user1:users /users/user1
4:更改bash的指向
usermod -s /bin/bash user1
5.在使用者端更改終端顏色(參考https://www.onlyke.com/html/807.html)

5.1首先
su user1
拷貝預設的.bashrc過來
cp /etc/skel/.bashrc ~/
5.2然後建立.profile檔案
vi ~/.profile
貼上下面的內容
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n
5.3 想立即生效,執行下面命令
source ~/.profile

 

轉載自一下文章

---------------------
作者:a137376864
來源:CSDN
原文:https://blog.csdn.net/a137376864/article/details/66980885