A
A
Arthur2019-03-17 16:42:29
linux
Arthur, 2019-03-17 16:42:29

How is $USER in a group but the group is empty?

ubuntu 18.04 shows that the user is in a group writes how can this be?
sudo groups $USERexample
sudo groups examplegroups: ‘example’: no such user

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Mezhuev, 2019-03-17
@ART_CORP

man groups:

NAME
       groups - print the groups a user is in

SYNOPSIS
       groups [OPTION]... [USERNAME]...

DESCRIPTION
       Print group memberships for each USERNAME or, if no USERNAME is specified,
       for the current process (which may differ if the groups database has changed).

That is, the command shows which groups the user is in, and not vice versa, which it tells you about:
The composition of groups can be viewed in the /etc/group file or with the command groupmems -g $GROUP -l.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question