Ask Your Question
0

From the CLI how to list the groups to which I belong?

asked 2016-05-13 12:59:51 -0600

paulhr gravatar image

The Fedora documentation assumes the use of a GUI. I am running the server edition. No GUI.

A second question is... how do I add a group to my id?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2016-05-14 01:13:43 -0600

snowolfe gravatar image

As a non-privileged user (your current userid is assumed):

$ groups to see just the list of group names that you belong to.

$ id to see uid, gid and all supplemental group names, with associated gid's, that you belong to.

As a privileged user (to see details of other user accounts):

$ sudo groups USERID

$ sudo id USERID

$ sudo usermod -aG GROUP1[,GROUP2]... USERID to append additional, supplemental groups to the userid. The -a is used to append groups; without it you will replace the existing supplemental list of groups.

edit flag offensive delete link more
0

answered 2016-05-13 13:21:46 -0600

The command groups will list the groups to which you belong and usermod -G <group> <userid> will allow you to add additional groups to a userid.

edit flag offensive delete link more

Comments

Bad command. This will put your user exclusively into <group>. It means you loose all other group memberships e.g wheel, which lets your user use the sudo command.

florian gravatar imageflorian ( 2016-05-14 22:20:53 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-05-13 12:59:51 -0600

Seen: 121 times

Last updated: May 14 '16