Ostap Kutsyy wrote:
> [EMAIL PROTECTED] ~]$ whoami
> ostap

Your current user name associated with your current process effective
uiser id is ostap.  Looks okay to me.

> [EMAIL PROTECTED] ~]$ id ostap
> uid=504(ostap) gid=504(ostap) groups=504(ostap),0(root),6(disk),501(cvs)

Lists the user and groups of the 'ostap' user if that user were to log
in at this moment.  Does not list the current process.  Does not list
past history of the process.  Does not list future possibilities.

> [EMAIL PROTECTED] ~]$ id
> uid=504(ostap) gid=504(ostap) groups=501(cvs),504(ostap)

Did you recently add 'ostap' to the 'root' and 'disk' groups?  Have
you logged in since then?

> [EMAIL PROTECTED] ~]$ id -un
> ostap

Basically the same as 'whoami'.  Looks okay to me.

> [EMAIL PROTECTED] ~]$ id -Gn
> ostap cvs

Again the group information.  Looks okay to me.

> [EMAIL PROTECTED] ~]$ id -Gn ostap
> ostap root disk cvs

Lists the groups of the 'ostap' user if that user were to log in at
this moment.  Does not list the current process.  Does not list past
history of the process.  Does not list future possibilities.

As noted in the documentation for id:

  `id' prints information about the given user, or the process running
  it if no user is specified.

The command prints *either* the specified user *or* the current
process.  Those may be different.

The kernel only places the user in the groups when the process is
launched at login time, usually through PAM.  You need to log in to
get current settings.  Usually that means logging out but you could
'ssh localhost' for example to spawn a login session through ssh.  See
the initgroups(2) and setgroups(2) man pages for more information.

Bob


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to