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

猜你喜欢

转载自www.cnblogs.com/cofludy/p/10193341.html