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

On a Linux machine, I am trying to run the udhcpc command as non-root. I am getting the error udhcpc: socket: Operation not permitted. Is there any way to execute udhcpc as a simple user in Linux?

share|improve this question

migrated from stackoverflow.com May 23 '11 at 20:17

This question came from our site for professional and enthusiast programmers.

This belongs on superuser.com – Ex Umbris May 23 '11 at 17:13
Do you really want a non-root user potentially changing the machine's IP address? – Ex Umbris May 23 '11 at 17:14

A dhcp client needs to bind an ICMP socket, and that requires root permissions¹. You can give a specific user permission to run dhcp through sudo. Run visudo to add a line like this to the configuration (joe is the name of the user to authorize):

joe ALL = (root) /sbin/udhcpc

¹ Or the appropriate capability, but they're not widespread yet.

share|improve this answer

Your Answer


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