1.2:查看组 #查看所有的组 cat /etc/group #查看当前登录用户的组内成员 groups #查看一个用户所在组的组内成员 groups 用户名 1.3修改组 #更换主组 useradd -g 组名 用户名 #更改用户的组,但主组不变 useradd -aG组名 用户名 #把组名进行修改 group 旧组名 -n 新组名 1.4删除组 #删除某一个
sudo 注:sudo 是通过另一个用户来执行命令(execute a command as another user),su 是用来切换用户,然后通过切换到的用户来完成相应的任务,但sudo 能后面直接执行命令,比如sudo 不需要root 密码就可以执行root 赋与的执行只有root才能执行相应的命令;但得通过visudo 来编辑/etc/sudoers来实现; visudo 注:visodo ...
# If defined, this command is run when removing a user. # It should remove any at/cron/print jobs etc. owned by # the user to be removed (passed as the first argument). # #USERDEL_CMD /usr/sbin/userdel_local # # If useradd should create home directories for users by default # O...
UID在999内 [root@localhost ~]# id dba uid=887(dba) gid=887(dba) groups=887(dba)4、-e选项...
2. Create, modify, and delete groups Like the user account commands described above, the group management commands are very intuitive and provide a lot of flexibility. There is an easy-to-remember command for each function you might need to carry out for a group: ...
example, that’s juser. The second set, group permissions, are for the file’s group (somegroup in the example). Any user in that group can take advantage of these permissions. (Use the groups command to see what group you’re in, and see 7.3.5 Working with Groups for more ...
You can also send the standard error to the same place as stdout with the >& notation. For example, to send both standard output and standard error to the file named f, try this command: 你也可以使用 >& 符号将标准错误发送到与stdout相同的位置。例如,要将标准输出和标准错误都发送到名为f的...
Change into the~/playgrounddirectory by using thecdcommand. You are ready to work with the commands and concepts below. When you've completed the article and learned the techniques I've covered, delete the two user accounts, the groups, and the playground directory. Userm -fR /playground,use...
owned by # the user to be removed (passed as the first argument). # #USERDEL_CMD /usr/sbin/userdel_local # # If useradd should create home directories for users by default # On RH systems, we do. This option is overridden with the -m flag on # useradd command line. # CREATE_...
useradd [-u uid] [-g group] [-G groups] [-d home_dir] [-s shell] [-c comment] [–m [-k skel_dir]] [-N] login 其中,login表示新增用户的注册用户名。其他选项的说明如表3-3所示。表3-3 useradd命令的常用选项例如,为了增加一个用户cathy,同时增加一个用户组cathy,可以使用下列命令:...