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 have a thin client with 112mb RAM which boots ubuntu server 12.04.1 from a usb drive with openbox and it is to be used by students to communicate with cisco equipment. And because of this the students need to be able to reconfigure the network interface and then restart it without a reboot using the only user - cisco.

This is what I have so far:

adduser cisco
usermod -a -G dialout cisco
chown root:cisco /etc/network/interfaces
chmod 664 /etc/network/interfaces
chmod u+s /sbin/shutdown
chmod u+s /sbin/reboot
chmod u+s /sbin/poweroff
chmod u+s /run/network/if*
chmod u+s /sbin/ifdown
chmod u+s /sbin/ifup

And when I run /etc/init.d/networking restart as cisco I get:

*Reconfiguring network interfaces...
rm: cannot remove `eth0.dhclient': Permission denied
Failed to send flush request: Operation not permitted
RTNETLINK answers: Operation not permitted

Any ideas on how to get this working?

Thanks!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You need to add proper sudo rights to the cisco user. Create one file in /etc/sudoers.d/ as root, named cisco, and with the following one line content:

cisco ALL=NOPASSWD: /etc/init.d/networking

Also change the access rights to read-only:

sudo chmod 440 /etc/sudoers.d/cisco

More the Ubuntu way would be to use the sudo service networking restart logic, but I do not know how to add this to sudoers file.

share|improve this answer
    
Works like a charm. Thanks! –  bonchen Dec 8 '12 at 11:45

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.