Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Skip Sudo command asking password?

  1. #11
    Join Date
    Jan 2008
    Beans
    8

    Re: Skip Sudo command asking password?

    i dont think this is it, i remember that my friend edited tow files i think, and this is my sudoers file:



    # /etc/sudoers
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # See the man page for details on how to write a sudoers file.
    # Defaults

    Defaults !lecture,tty_tickets,!fqdn

    # Uncomment to allow members of group sudo to not need a password
    # %sudo ALL=NOPASSWD: ALL

    # Host alias specification

    # User alias specification

    # Cmnd alias specification

    # User privilege specification
    root ALL=(ALL) ALL

    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL






    all lines are comented out, so i dont understand!

    ps: i do remember my friend edited the group files, something with the weel group.

    help please!
    Last edited by phantom74; February 6th, 2008 at 02:50 PM.

  2. #12
    Join Date
    Jul 2007
    Beans
    1,577

    Re: Skip Sudo command asking password?

    Well, I'm no expert on sudo, but I do know that some distros use the wheel group in a similar way to how Ubuntu uses the admin group. I see that only the admin group is mentioned in your sudoers file. Otherwise the file looks very much like mine. You could try removing the wheel group, if it exists.

    Check out the man page for sudo for a proper treatment of the subject.

  3. #13
    Join Date
    Jun 2006
    Beans
    9
    Distro
    Ubuntu 6.06

    Re: Skip Sudo command asking password?

    Hi everybody,

    I am struggling with the same problem and no matter what I do it does not work.

    This is my sudoers file part with the modifications

    Code:
    # User privilege specification
    root    ALL=(ALL) ALL
    william ALL=(root) NOPASSWD: /usr/sbin/g15daemon
    william ALL=(root) NOPASSWD: /usr/sbin/visudo
    the sudo -l command gives
    Code:
    william@attigliano:~$ sudo -l
    User william may run the following commands on this host:
        (root) NOPASSWD: /usr/sbin/g15daemon
        (root) NOPASSWD: /usr/sbin/visudo
        (ALL) ALL
    william@attigliano:~$
    And still when I do sudo visudo I am asked for a password ?

    Where is my mistake ?
    (I have read and reread all the man sudo pages and still no ideas....)

    Thanks a lot.

  4. #14
    Join Date
    Jun 2006
    Beans
    9
    Distro
    Ubuntu 6.06

    Exclamation Re: Skip Sudo command asking password?

    Ok Gotcha !!
    With the help of a good friend that found the ref to https://bugs.launchpad.net/ubuntu/+s...do/+bug/131399

    Problem is that the last line is uncommented and it overrides what I have done.

    that last line
    # Members of the admin group may gain root privileges

    %admin ALL=(ALL) ALL

    allow members of the amdin group to run any command BUT with a password.

    So removing password for some command before this one will not work !!

    Have a very happy new year !!

  5. #15
    Join Date
    Jun 2010
    Location
    Kuwait
    Beans
    56
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Skip Sudo command asking password?

    Quote Originally Posted by RezoApio View Post
    Hi everybody,

    I am struggling with the same problem and no matter what I do it does not work.

    This is my sudoers file part with the modifications

    Code:
    # User privilege specification
    root    ALL=(ALL) ALL
    william ALL=(root) NOPASSWD: /usr/sbin/g15daemon
    william ALL=(root) NOPASSWD: /usr/sbin/visudo
    the sudo -l command gives
    Code:
    william@attigliano:~$ sudo -l
    User william may run the following commands on this host:
        (root) NOPASSWD: /usr/sbin/g15daemon
        (root) NOPASSWD: /usr/sbin/visudo
        (ALL) ALL
    william@attigliano:~$
    And still when I do sudo visudo I am asked for a password ?

    Where is my mistake ?
    (I have read and reread all the man sudo pages and still no ideas....)

    Thanks a lot.
    This approach worked for me on ubuntu Desktop, but did not work on Ubuntu server, I don't know why

  6. #16
    Join Date
    Dec 2005
    Location
    UK
    Beans
    33
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Skip Sudo command asking password?

    Quote Originally Posted by majedaly View Post
    This approach worked for me on ubuntu Desktop, but did not work on Ubuntu server, I don't know why
    Hi, just had the same problem here, to get over it i had first to add me to group root EG, in a terminal;

    sudo usermod -a -G root chris


    Then i had to hash out %ADMIN line in the sudoers file and all mods to sudoers to allow passwordless sudo commands where of the form, EG;

    chris ALL = (ALL) NOPASSWD: /sbin/shutdown, /sbin/reboot

    Be prepared next to boot into a live CD and remove the hash from the %ADMIN line if you get into trouble. I did but my system is working just as it should even with the reversion.

    Chris

  7. #17
    Join Date
    Mar 2009
    Beans
    6

    Re: Skip Sudo command asking password?

    Quote Originally Posted by toojays View Post
    You control sudo through the "sudoers" file. To edit this file, run "sudo visudo".

    I haven't tested this, but I think the following would allow all users in the "cdrom" group to run "sudo k3b" without needing a password:
    Code:
    %cdrom    ALL = NOPASSWD: /usr/bin/k3b
    For more information, see the sudoers man page.


    Sorry to bring back a dead thread but I think I figured out why this wasn't working for a lot of people. The entry you put needs to be at the end, not at the top. Since the addition you make gets over-rid by another entry lower on in the sudoers file.

    Here's what I did to run a specific program as sudo without prompting for a password in Meerkat:

    Run this in terminal: sudo visudo
    At the END of the file, type in: "%yourusername ALL=NOPASSWD: /app/you/want/to/run/as/sudo" without the quotes

    Hope this helps someone looking to run something as sudo without prompting for a password.

  8. #18
    hakermania's Avatar
    hakermania is offline Τώρα ξέρεις τι γράφω εδώ!
    Join Date
    Aug 2009
    Location
    Greece
    Beans
    1,702
    Distro
    Ubuntu Development Release

    Re: Skip Sudo command asking password?

    Code:
    echo "passwd" | sudo -S synaptic
    Website

    Wallch (Wallpaper Changer): Sourceforge | Launchpad

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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