如何自动协调 /etc/group 和 /etc/gshadow

Bry*_*anH 17 linux shell user-management

运行grpck检查组,我看到这些错误:

 'twinky' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
 'dipsy' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
 'laalaa' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
 'po' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
 'noonoo' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
 'dipsy' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
 ...
Run Code Online (Sandbox Code Playgroud)

......还有很多。我不确定这是怎么发生的,我想把它清理干净。我知道我可以手动编辑/etc/gshadow,但我宁愿让操作系统来做,以防止打字错误和体力劳动。

有什么可以自动将一个组调和成 gshadow 的吗?也许类似(编造):

# grpfix foo
Run Code Online (Sandbox Code Playgroud)

我已经在各种与组相关的命令上尝试过 man 并用谷歌搜索,但到目前为止我还没有找到答案。

Bry*_*anH 23

男人有我之前错过的答案:

grpconv
Run Code Online (Sandbox Code Playgroud)

http://linux.die.net/man/8/grpconv

grpconv 命令从组和一个可选的现有 gshadow 创建 gshadow。