28

I want to grant a user sudo access.

I suppose mainly I want to grant privileges to install software, and am not quite sure how to this in CentOS:

https://linuxize.com/post/how-to-add-user-to-sudoers-in-centos/

wheras in Ubuntu the option, at least as I recall, is:

sudo adduser foo sudo

to add user foo to sudo. I'm also curious as to why this isn't available in CentOS -- perhaps it's not fine grained enough?

[nsaunders@rolly ~]$ 
[nsaunders@rolly ~]$ sudo usermod -aG sudo rdegamma
usermod: group 'sudo' does not exist
[nsaunders@rolly ~]$ 

1 Answer 1

55

The group in CentOS isn't called sudo. It's call wheel.

As root:

usermod -aG wheel rdegamma

You then need to run visudo and uncomment the below line in the sudoers file if you haven't already:

%wheel  ALL=(ALL)       ALL

Have the user start a new shell session to enter their password for sudo.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.