groupdel: cannot remove the primary group of user 'lxh1'的解决办法

简介:

【故障现象】用groupdel删除test组时,报以上错误。原因为test组中有lxh1用户(lxh1的主组)。

【解决办法】更改lxh1的主组后即可删除。

1
2
3
4
5
6
7
8
root@oldboy ~$tail -n 2 /etc/group
lxh:x:500:
test:x:888:
root@oldboy ~$usermod -g lxh lxh1
root@oldboy ~$groupdel test
root@oldboy ~$tail -n 2 /etc/group
apache:x:48:
lxh:x:500:

【注意事项】

-g与-G区别

-g, --gid GROUP               force use GROUP as new primary group
-G, --groups GROUPS           new list of supplementary GROUPS

-g是更改用户的主组

-G是将用户加到新的组里

usermod -g groupname username

usermod -G groupname username




本文转自 xoyabc 51CTO博客,原文链接:http://blog.51cto.com/xoyabc/1687511,如需转载请自行联系原作者

相关文章
|
Ubuntu 数据安全/隐私保护
All data created during this guest session will be deleted when you log out 问题的解决
All data created during this guest session will be deleted when you log out 问题的解决
209 0
|
数据库
MongoError: E11000 duplicate key error collection: blog.users index: email_1 dup key
MongoError: E11000 duplicate key error collection: blog.users index: email_1 dup key
|
SQL 关系型数据库 MySQL
mysql使用ORDER BY和GROUP BY
mysql使用ORDER BY和GROUP BY
66 0
|
存储 关系型数据库 MySQL
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
4256 0
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
|
关系型数据库 MySQL 数据库
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
302 0
[Err] 1143 - SELECT command denied to user 'XX'@'%' for column 'XXX' in table 'XX'
|
SQL 数据库管理 关系型数据库
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
测试环境:OEL6.5+Oracle 11g R2在进行执行计划测试的时候,遇到一个小问题。在用普通用户执行下面这条命令的时候,普通用户名为hhu,已经赋予了create session和resource权限。
1142 1