列出linux用户

我需要在Linux中find一个不出现在我的/ etc / groups文件中的

我运行以下命令并出现错误

sudo adduser --disabled-login --gecos 'GitLab' git adduser: The group `git' already exists. 

但是当我运行下面的命令时,没有组git

 cat /etc/group | grep git #no results cat /etc/passwd | grep git #no results cat /etc/shaddow |grep git #no results 

这是一个全新的Ubuntu 12.04盒子,除了与LDAP绑定外,没有任何变化。 甚至还没有安装vim或git。

为什么我得到了组git已经存在的错误? 有没有什么办法呢? 我想要安装gitlab 。

检查/etc/nsswitch.conf ,特别是groups行。 也检查输出

$ getent groups git

找出为什么你会得到关于已经存在的组的错误。

参考: man nsswitch.conf(5)man getent(1)

尝试将它们join到它认为在那里的组中

 sudo adduser --disabled-login --gecos 'GitLab' git git 

要么

 sudo adduser --disabled-login --gecos 'GitLab' --ingroup git git 

你也可以尝试删除组,看看会发生什么

 groupdel git