You are not logged in.

#1 2011-05-20 12:08:26

pedro_sland
Member
Registered: 2010-05-21
Posts: 15

[Solved] Add group to Sudoers file

Hi everyone,

I feel this is a very stupid newbie question. I am trying to give a user access to sudo. I have two lines uncommented in /etc/sudoers:

root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL

I am using visudo but it edits with nano.

I have tried to add this user to the wheel group (usermod -G wheel -a peter).

Do I need to run a command or reboot?

This is the result of the groups command so I think I have added the user to the group.

# groups peter
wheel peter

Last edited by pedro_sland (2011-05-20 19:56:57)

Offline

#2 2011-05-20 12:19:40

hcjl
Member
From: berlin
Registered: 2007-06-29
Posts: 330

Re: [Solved] Add group to Sudoers file

you have to use

gpasswd -a peter wheel

. after that you have to log out / in.

Offline

#3 2011-05-20 12:29:08

Awebb
Member
Registered: 2010-05-06
Posts: 6,291

Re: [Solved] Add group to Sudoers file

To be precise: Peter has to log out and in again.

Offline

#4 2011-05-20 12:45:08

pedro_sland
Member
Registered: 2010-05-21
Posts: 15

Re: [Solved] Add group to Sudoers file

Thanks! That worked great.

I'm confused now though. What exactly does "usermod -G" do and what does "gpasswd -a" do? I did man and google it but I wasn't any clearer about the difference.

Offline

#5 2011-05-20 12:55:26

hcjl
Member
From: berlin
Registered: 2007-06-29
Posts: 330

Re: [Solved] Add group to Sudoers file

in your first post your wrote groupadd -G.

for the rest

man gpasswd
man groupadd
man usermod

and this https://wiki.archlinux.org/index.php/Us … management
;-)

Last edited by hcjl (2011-05-20 13:01:43)

Offline

#6 2011-05-20 13:02:26

pedro_sland
Member
Registered: 2010-05-21
Posts: 15

Re: [Solved] Add group to Sudoers file

yikes I did write groupadd! I know what that does. Man tells me there is no -G for groupadd so I'm certain I didn't do that. I meant usermod -G. I've read the man pages again but as far as I can understand, "usermod -G wheel -a peter" should have worked. What am I missing?

Offline

#7 2011-05-20 18:37:04

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: [Solved] Add group to Sudoers file

problem is solved, please mark as [SOLVED]

Offline

#8 2011-05-20 18:57:41

pedro_sland
Member
Registered: 2010-05-21
Posts: 15

Re: [Solved] Add group to Sudoers file

@roygbiv
While the problem is solved I refrained from marking it as such as I was hoping someone would answer my question in #6 (it was a deliberate choice not to mark it as solved).

Offline

#9 2011-05-20 19:54:28

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: [Solved] Add group to Sudoers file

pedro_sland wrote:

yikes I did write groupadd! I know what that does. Man tells me there is no -G for groupadd so I'm certain I didn't do that. I meant usermod -G. I've read the man pages again but as far as I can understand, "usermod -G wheel -a peter" should have worked. What am I missing?

The command is correct and should have worked as expected.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#10 2011-05-20 19:56:41

pedro_sland
Member
Registered: 2010-05-21
Posts: 15

Re: [Solved] Add group to Sudoers file

Strange. Thanks loafer, hcjl and Awebb for your contributions.

Offline

Board footer

Powered by FluxBB