How do I add myself to the "wheel" group to use cvs?

17

8

I am on a Mac (Snow Leopard) and I would like to add myself to the "wheel" group? How do I do that? I there a way I can see all the groups am I in?

iHeartDucks

Posted 2009-11-03T03:59:22.433

Reputation: 295

root is the only member of the wheel group, and should remain the only member. If you have to do something that requires wheel, you should use the command sudo. – DawnSong – 2019-09-30T11:31:11.897

Answers

17

You can see what groups you are in using the id command:

$ id testacc 
uid=1089(testacc) gid=1096(testacc) groups=1096(testacc)

the dscl utility can be used to add users to groups:

$ dscl . append /Groups/admin GroupMembership username

where username is the user short name of the user you wish to add to the particular group.

John T

Posted 2009-11-03T03:59:22.433

Reputation: 149 037

12

There is arguably a better command to check what group one belongs to. The "groups" command. Example:

$ groups

staff _developer _lpoperator _lpadmin _appserveradm admin _appserverusr localaccounts everyone com.apple.access_ssh com.apple.access_screensharing

The command to add group wheel:

$ sudo dscl . append /Groups/wheel GroupMembership username

Where "username" is your username. Then re-run "groups" to see that you have indeed been added to group wheel, like so:

$ groups                                                  
staff _developer _lpoperator _lpadmin _appserveradm admin _appserverusr localaccounts everyone wheel com.apple.access_ssh com.apple.access_screensharing

The Onibor

Posted 2009-11-03T03:59:22.433

Reputation: 121

2groups(1) does work as well, but it's deprecated in favour of id(1) (at least as of OSX 10.7). – Viktor Haag – 2011-12-19T16:26:02.130