Find the answer to your Linux question:
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 ...
  1. #1
    Just 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.

  2. #2
    Linux 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:
    Code:
    visudo
    Then add an entry like this:
    Code:
    # allow user 'joeblow' to change ip address
    jowblow ALL = (root) NOPASSWD: /sbin/ifconfig *
    jowblow ALL = (root) NOPASSWD: /sbin/ip *
    Then joeblow would do something like:
    Code:
    sudo /sbin/ifconfig eth0 1.2.3.4
    He could also set up an alias in his .bashrc like:

    alias ifconfig='sudo /sbin/ifconfig'

    and then he would just have to do:
    Code:
    ifconfig eth0 1.2.3.4
    If you only wanted to give your user access to a particular device, then in your visudo line, you could say:
    Code:
    jowblow ALL = (root) NOPASSWD: /sbin/ifconfig eth0 *
    hth

  3. #3
    Just Joined!
    Join Date
    Jun 2011
    Posts
    2
    Hi i have tried. somehow its doest work. still prompting for root password.

  4. #4
    Linux Guru
    Join Date
    May 2011
    Posts
    1,845
    Show the contents of your sudoers file (run this as root):
    Code:
    cat /etc/sudoers
    As the non-root user, show sudo commands the user is permitted to run:
    Code:
    sudo -l
    (that's a lowercase "L")

    Also, show the exact command you are trying to run.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...