Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I'm running unbuntu 12.04. I want a script to be able to run "ip link blah blah...".

sudo ./

works as intended, but


gets me : RTNETLINK answers: Operation not permitted

I have these lines in my sodoers file:

myusername ALL = (ALL:ALL) NOPASSWD: ALL
%mygroup ALL = (ALL:ALL) NOPASSWD:/sbin/ip, /bin/ip

There are no lines following this except a timeout for the timestamp, and the default reference to /etc/sudoers.d

/etc/sudoers.d is empty except for the default README file.

NOPASSWD does not seem to be working either. I have tried moving the lines around so that the timeout and sudoers.d lines are before the ones I mostly care about, with no effect.

What have I missed?

share|improve this question
up vote 0 down vote accepted

The /etc/sudoers file only applies to sudo. That means that if you do not run programs with sudo, it will not get a chance to get elevated privileges. You must use sudo ./ or edit the script and change something like:

ip link ...


sudo ip link ...
share|improve this answer
Duh, of course. I knew it would be something simple... Thanks! – mickeyf Jan 21 '13 at 16:58

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.