
# useradd chen
2.设置用户的密码
# passwd chen
之后输入用户的新密码,和确认密码即可完成去登陆
3.赋予用户root权限
一、方式一
a.打开文件夹 etc下面 sudoers 文件
# vim /etc/sudoers
b.找到( ## Allow root to run any commands anywhere )
在这下面默认有一个( root ALL=(ALL) ALL )
在下面进行添加刚刚新创建的用户
chen ALL=(ALL) ALL
c.保存并且退出
esc ->:wq
二、方式二
#usermod -g root tommy
修改完毕,现在可以用 chen 帐号登录,然后用命令 # su – ,即可获得root权限进行 *** 作。
linux系统修改user1用户id为600,描述为student1,使用什么命令在linux *** 作系统中,为user01用户添加属组+student的命令是
您好亲,
1、用useradd添加用户
Useradd student1——创建用户st1
Useradd –e 12/31/2004 student2——创建student2,指定2004-12-31到期
用户的缺省工作目录是/home/username,可以指定其他目录为其工作目录,例:useradd
student3 –d /student/student3
用户的缺省UID从500后顺序增加,可以指定UID。例:useradd –u 600 student4
如果不指定用户所属的工作组,在创建用户的时候会生成一个与用户名同名的工作组,也可以在
创建用户的时候就指定其工作组。例:useradd –g student student 5
2、用passwd为用户设置密码
例:passwd student1
注意:没有设置密码的用户不能使用。
3、usermod修改用户账户
例:将用户student1的登录名改为st1,
usermod –l st1 student1
例:将用户加入到student组中,
Usermod –g student student1
例:用户目录改为/student/student1
usermod –d /student/student1 student
希望可以帮助你哦
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)