Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Calling dhclient as root works beautifully on my debian machine. However, I would like to allow some users to execute dhclient, too. So far, I have tried these two examples:

Example 1: When a normal user calls

user@box:~$ dhclient

..., the result is:

bash: dhclient: command not found

Example 2: I have also tried

user@box:~$ /sbin/dhclient

..., and got


can't create /var/lib/dhcp3/dhclient.leases: Permission denied
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFFLAGS: Permission denied
Open a socket for LPF: Operation not permitted

Now... I have the feeling it is neither a good a idea (or would work) to chmod the entire /sbin directory for user access, nor does it appear to be elegant to chmod everything dhclient complains about in the second example above. What is the best and safest way to attack this issue?

share|improve this question
up vote 5 down vote accepted

Install and use sudo. It's the one and most sane way of doing these things. dhclient really needs root privileges, there's no way around it.

Allow specific users to execute a single command with root privileges. This can be configured in a /etc/sudoers file like this (edit using visudo):

Cmnd_Alias     DHCP = /usr/sbin/dhclient
User_Alias     DCHPUSERS = millert, mikef, dowdy


Above is just one way of configuring sudo. If you have a lot of users to administer like this, I suggest to use a local user group instead of specifying individual users.

share|improve this answer

Your Answer


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.