Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd specifically like them to be able to use the Network Manager.

share|improve this question
add comment

1 Answer

Here's one way to do it by narrowing the scope of sudo users and commands.

Create a new sudoers file by any name:

sudo visudo -f /etc/sudoers.d/network-config

Add the contents of the file (with real usernames and any real additional commands of course)...

User_Alias NET_CFG_USERS = username1, username2, username3
Cmnd_Alias NET_CFG_CMNDS = /usr/bin/nm-connection-editor, command2, command3
NET_CFG_USERS ALL = (root) NET_CFG_CMNDS

Save & quit. Now the named users can open a terminal to change settings, using their own password:

sudo nm-connection-editor

Success?

Some notes: It is critical that you use visudo and no other method for this, or else sudo may break. Please consider reading that post first to make sure you avoid the problem. In short, sudo appears to have been programmed not to work at all if the permissions of a sudoers file is not 0440. The visudo command creates files with the right permissions. Whereas, were you to do this:

sudo -e /etc/sudoers.d/network-config

you could temporarily wind up without administrative access.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.