I want to allow users to control the em1 device in Linux:
When I run this command:
ifdown em1
em1 is the embedded ethernet card 1, I want the user to be able to turn off the ethernet card.
On Fedora 17, I get this error message:
Users cannot control this device
I want a certain user to be able to run a certain command on Linux without giving rights to other users. What is the best way to do that?
Add this line to
/etc/sysconfig/network-scripts/ifcfg-em1
:Then any user can run
ifup em1
/ifdown em1
.You can use
sudo
to give the user on Fedora 17 the rights to control the em1 device:First verify that you infact cannot run
ifdown em1
as a user.Login to a terminal as root
Install sudo if you don't already have it
open up the
visudo
permissions editorNote, if you don't know how to use the
vi
editor, you'll either have to learn how or set the visudo path to editor as something else.this allows you to edit what users can do which commands as root on your system
At the bottom of the file that is opened add these commands:
Save the visudo file, Get out of root, login as a user, and see if you can control em1