Find the answer to your Linux question:
Results 1 to 8 of 8
Hi, I tryed to work with sudo for Quite a while now. I thought I understood how it worked. But I just figured out I was wrong.. Anywho, I cant ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429

    Problems with Sudo Config


    Hi, I tryed to work with sudo for Quite a while now.
    I thought I understood how it worked.
    But I just figured out I was wrong..
    Anywho, I cant make that part with the % groups work..
    So my sudoers file is this:
    Code:
    Host_Alias LOCAL = 127.0.0.1
    Cmnd_Alias SCRIPT = /bin/mount, /usr/sbin/chroot
    Cmnd_Alias NOT = /bin/halt
    
    #Now a part I dont even get.. :S
    Defaults requiretty
    Defaults env_reset
    Defaults env_keep = "(lots of env Variables here)"
    #At this point I start understanding it again.
    root ALL=(ALL) ALL
    %users LOCAL = NOPASSWD: SCRIPT
    %users LOCAL = !NOT
    I tryed to make a new group and then run adduser with the -g ### parameter.
    That didnt work.
    So, well the group users is everybody right?
    Well, I make users now with adduser -m $NEWUSERNAME

    Why doesnt it work?
    Why cant I use the sudo command with every new user?

    Well, thanks alot.
    Cheers,
    Robin
    New Users, please read this..
    Google first, then ask..

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    Bump

    I tryed a couple of things.
    I know for sure that the user is in the Group. Since I did that with webmin.
    But I still get, User: isn't allowed to do..

    Oh, and when i do sudo -l I get a password prompt
    And then I get user isnt allowed any command.
    New Users, please read this..
    Google first, then ask..

  3. #3
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    sudo, incredibly useful and a pain in the a$$ at the same time

    %users is an example, refering to the group users.

    You could add everyone to the users group.

    This should give you a list of users on the system

    Code:
    # cat /etc/passwd | awk 'BEGIN {FS=":"} {if ($3>499) print $1;}'
    If your happy with that list do the following to add them all to the users group.

    Code:
    # for i in $(cat /etc/passwd | awk 'BEGIN {FS=":"} {if ($3>499) print $1;}'); do usermod -G users $i; done;
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  4. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Oh, if your using samba and machine accounts change the awk script to this one which ignores usernames ending with a $

    Code:
    awk 'BEGIN {FS=":"} {if ($3>499) if ($1 !~ /\$+$/) print $1;}'
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  5. #5
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    In the meanwhile I have fixed it already..
    Thanks any how
    New Users, please read this..
    Google first, then ask..

  6. #6
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    No problem, what solution did you come up with in the end?
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  7. #7
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    Dont use SUDO :P
    New Users, please read this..
    Google first, then ask..

  8. #8
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Dont use SUDO :P
    Indeed! LMAO
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

Posting Permissions

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