在linux上,将用户添加到用户组。 请不要直接使用。
用户模块- g组
这种操作的缺点如下。
您只需要脱离其他用户组,成为此用户组组的成员。
正确的方法是添加-a选项。
usermod-a-g组用户
(fc 4:用户组- g组、组、组用户)
-a表示应用。 也就是说,在不脱离其他用户组的情况下将自己添加到用户组groupA中。
命令的所有选项及其含义:
Options:
-c,--commentcommentnewvalueofthegecosfield
-d,--home home _ dirnewhomedirectoryfortheuseraccount
-e,--expiredateexpire _ datesetaccountexpirationdatetoexpire _ date
-f,--inactiveinactivesetpasswordinactiveafterexpiration
待办事项
-g,--gidgroupforceusegroupasnewprimarygroup
-G,--groupsgroupsnewlistofsupplementarygroups
a,--appendappendtheusertothesupplementalgroups
按照维护选项进行远程迁移
him/her from other groups
-h,--helpdisplaythishelpmessageandexit
-l,--logi nnew _ loginnewvalueoftheloginname
-L,--lock lock the user account
-m,--move-homemovecontentsofthehomedirectorytothenew
位置(用户友好- d ) )。
-o,- -非唯一低功耗复制(非唯一) UID
-p,--passwordpassworduseencryptedpasswordforthenewpassword
-s,--壳newlogin壳fortheuseraccount
-u,--uiduidnewuidfortheuseraccount
u,--unlock unlock the user account
查看用户所属组的使用命令: $ groups user
或查看文件: $ cat /etc/group