Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Right now all my users need to be root to issue the command dhcpcd -d eth0 to connect to the internet. I would like all my users to have this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User ImNeat's Avatar
    Join Date
    Feb 2006
    Location
    N. America
    Posts
    392

    Howto allow regular user to connect to Internet?


    Right now all my users need to be root to issue the command
    dhcpcd -d eth0
    to connect to the internet.

    I would like all my users to have this power. What do I need to do to allow regular users to issue the command?
    10" Sony Vaio SRX99P 850MHz P3-M 256MB RAM 20GB HD : ArchLinux
    14" Dell Inspiron 1420N 2GHz Core2Duo 2GB RAM 160GB HD : Xubuntu

  2. #2
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    It's not a direct solution but you can use "sudo"
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  3. #3
    Linux User ImNeat's Avatar
    Join Date
    Feb 2006
    Location
    N. America
    Posts
    392
    I don't think you can sudo in arch, I'd prolly have to add it somehow. But even so, that still requires the root password which is what I'm trying to prevent needing.
    10" Sony Vaio SRX99P 850MHz P3-M 256MB RAM 20GB HD : ArchLinux
    14" Dell Inspiron 1420N 2GHz Core2Duo 2GB RAM 160GB HD : Xubuntu

  4. #4
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    You can use "sudo" in any distro, but you have to edit the sudoers file, it doesn't work out of the box. You can set sudo just for one command and use it without root password but again, you need to install it and edit the sudoers file
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  5. #5
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    ImNeat, if Arch does not come with sudo, surely you can install it. By default sudo prompts for the password of the invoking user (not root), and you can even turn that off if you're so inclined. There is very thorough documentation in man 5 sudoers.

    --------------------------------------------

    But... ignoring sudo for the moment:

    Why do you not have eth0 obtain an IP address via dhcp at boot time? Is there a reason to jump through extra hoops and run the command yourself?

  6. #6
    Linux User ImNeat's Avatar
    Join Date
    Feb 2006
    Location
    N. America
    Posts
    392
    So there's no way to set it up so that a regular user can
    Code:
    dhcpcd eth1
    or
    Code:
    shutdown -h now
    ?!
    Logging in as root or sudoing are the only options?

    That's strange...
    10" Sony Vaio SRX99P 850MHz P3-M 256MB RAM 20GB HD : ArchLinux
    14" Dell Inspiron 1420N 2GHz Core2Duo 2GB RAM 160GB HD : Xubuntu

  7. #7
    Just Joined! theLinuxPeasant's Avatar
    Join Date
    Nov 2006
    Location
    York,UK - Athens, Greece
    Posts
    7
    Check this out, it may help.

    HTML Code:
    http://www.linuxforums.org/forum/misc/57563-halt-reboot-permissons-normal-user.html?highlight=shutdown+user

  8. #8
    Linux User ImNeat's Avatar
    Join Date
    Feb 2006
    Location
    N. America
    Posts
    392
    I ended up just installing sudo, and setting it up so that certain users can issue certain root commands without password:
    Code:
    #/etc/sudoers
    user1        ALL = NOPASSWD: /sbin/shutdown
    user1        ALL = NOPASSWD: /sbin/dhcpcd
    user1        ALL = NOPASSWD: /usr/sbin/dhcpcd
    user1        ALL = NOPASSWD: /usr/sbin/iwconfig
    user1        ALL = NOPASSWD: /usr/sbin/iwlist  
    
    user2        ALL = NOPASSWD: /sbin/shutdown
    user2        ALL = NOPASSWD: /sbin/dhcpcd
    user2        ALL = NOPASSWD: /usr/sbin/dhcpcd
    user2        ALL = NOPASSWD: /usr/sbin/iwconfig
    user2        ALL = NOPASSWD: /usr/sbin/iwlist
    Wasn't sure if I needed to add /sbin or /usr/sbin for dhcpcd so I added both... (what's the difference?)

    Now
    Code:
    [user1/2@vaio ~]# sudo shutdown -h now
    works without password.

    Thanks to all for the replies.
    10" Sony Vaio SRX99P 850MHz P3-M 256MB RAM 20GB HD : ArchLinux
    14" Dell Inspiron 1420N 2GHz Core2Duo 2GB RAM 160GB HD : Xubuntu

  9. #9
    Linux User ImNeat's Avatar
    Join Date
    Feb 2006
    Location
    N. America
    Posts
    392
    Does anyone know how to set sudo flags? I would like to set the insult flag:
    insults If set, sudo will insult users when they enter an incorrect
    password. This flag is off by default.
    ^from the sudoers manpage.

    I still suck at reading/understanding manpages, so I can't decipher how to enable the flag/parameter.
    10" Sony Vaio SRX99P 850MHz P3-M 256MB RAM 20GB HD : ArchLinux
    14" Dell Inspiron 1420N 2GHz Core2Duo 2GB RAM 160GB HD : Xubuntu

  10. #10
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    Wasn't sure if I needed to add /sbin or /usr/sbin for dhcpcd so I added both... (what's the difference?)
    Whre the binary is, /sbin is for essential system binaries, /usr/sbin is for non-essential system binaries



    Sorry, I don't know about "sudo" flags
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

Page 1 of 2 1 2 LastLast

Posting Permissions

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