1.useradd
在Ubuntu14.04下创建一个新的用户:
Step1:添加新用户
useradd test -d /home/test -m
Step2:配置新用户密码
passwd test
Step3:给新添加的用户增加ROOT权限
vim /etc/sudoers
然后添加:
test ALL=(ALL:ALL) ALL
2.userdel
删除用户
3.groupadd
添加用户组
4.groups
查看用户所在的组
lili@lili-HP-Compaq-Pro-6300-MT:~$ groups lili
lili : oinstall
lili@lili-HP-Compaq-Pro-6300-MT:~$ groups oracle
oracle : oinstall dba
lili@lili-HP-Compaq-Pro-6300-MT:~$ groups test
test : oinstall
可以在创建用户的时候指定用户组和用户的附加组,这样用户创建的文件都是指定的用户组中的
useradd oracle -d /home/oracle -g oinstall -G dba -m