Results 1 to 4 of 4
HI all.
how to to allow user change the IP address, using network manager, without authenticate the root password.
or how to assign sudo, for particular user, to let them ...
- 06-30-2011 #1Just Joined!
- Join Date
- Jun 2011
- Posts
- 2
How to allow user change IP address without root password
HI all.
how to to allow user change the IP address, using network manager, without authenticate the root password.
or how to assign sudo, for particular user, to let them change them IP address only.
it will help me. thank you.
- 07-01-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,845
You can have a non-root user control the device (ifup, ifdown, etc.) the device with the use of the "USERCTL" parameter in the /etc/sysconfig/network-scripts/ifcfg-ethN config file. Just set it to 'yes'.
That won't allow them to change the ip address though. Make a sudo entry allowing them to run ifconfig (or ip), e.g.:
Run visudo, which safely edits the sudoers file:
Then add an entry like this:Code:visudo
Then joeblow would do something like:Code:# allow user 'joeblow' to change ip address jowblow ALL = (root) NOPASSWD: /sbin/ifconfig * jowblow ALL = (root) NOPASSWD: /sbin/ip *
He could also set up an alias in his .bashrc like:Code:sudo /sbin/ifconfig eth0 1.2.3.4
alias ifconfig='sudo /sbin/ifconfig'
and then he would just have to do:
If you only wanted to give your user access to a particular device, then in your visudo line, you could say:Code:ifconfig eth0 1.2.3.4
hthCode:jowblow ALL = (root) NOPASSWD: /sbin/ifconfig eth0 *
- 07-03-2011 #3Just Joined!
- Join Date
- Jun 2011
- Posts
- 2
Hi i have tried. somehow its doest work. still prompting for root password.
- 07-03-2011 #4Linux Guru
- Join Date
- May 2011
- Posts
- 1,845
Show the contents of your sudoers file (run this as root):
As the non-root user, show sudo commands the user is permitted to run:Code:cat /etc/sudoers
(that's a lowercase "L")Code:sudo -l
Also, show the exact command you are trying to run.


Reply With Quote