Results 1 to 8 of 8

Thread: Sudo without password

  1. #1
    Join Date
    Jun 2007
    Location
    San Diego, CA
    Beans
    27
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Sudo without password

    I have a problem with ubuntu lucid's sudo app. I don't want to enter password each time I sudo. Adding the folowing line in sudoers file
    Code:
     user       ALL=(ALL) NOPASSWD: ALL
    was working in the previous as far as I remember. But in the current version (lucid lynx) it doesn't work anymore. Is this feature disabled in lucid? or I should just change the line in an appropriate way (how?).

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Sudo without password

    Syntax is wrong. You did use visudo to edit /etc/sudoers, right?

    From here.

    Code:
    <username> ALL=NOPASSWD: ALL
    Last edited by CharlesA; September 11th, 2010 at 12:53 PM.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Jun 2007
    Location
    San Diego, CA
    Beans
    27
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Sudo without password

    !
    Last edited by phoenix7; September 11th, 2010 at 08:21 PM.

  4. #4
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,294
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Sudo without password

    Quote Originally Posted by CharlesA View Post
    Syntax is wrong. You did use visudo to edit /etc/sudoers, right?
    The syntax is correct.

    @phoenix7: make sure you put your user line below the %admin line (or comment the %admin one out). It's a "last match wins", so if the %admin line is last, it will override your user line.
    「明後日の夕方には帰ってるからね。」


  5. #5
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Sudo without password

    Quote Originally Posted by Bachstelze View Post
    The syntax is correct.

    @phoenix7: make sure you put your user line below the %admin line (or comment the %admin one out). It's a "last match wins", so if the %admin line is last, it will override your user line.
    Ah. Thanks. I wonder why it spit back an error when I tried it.

    I probably mistyped something.

    Would having ALL=(ALL) necessary if you are already in the admin group?
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  6. #6
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,294
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Sudo without password

    Quote Originally Posted by CharlesA View Post
    Would having ALL=(ALL) necessary if you are already in the admin group?
    The fact that you are in the admin group is irrelevant: as I said, if the user line is placed below the %admin line, it will completely override it.

    That being said, having ALL=(ALL) is indeed not necessary here: if you can run commands as root, you can run commands as any user. If you try to run a command directly as any user but root, you will have to type your password (assming the %admin line is still there, otherwise you will get permission denied).
    「明後日の夕方には帰ってるからね。」


  7. #7
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Sudo without password

    Thanks! That makes sense now.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  8. #8
    Join Date
    Jun 2007
    Location
    San Diego, CA
    Beans
    27
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Sudo without password

    Thanks CharlesA & Bachstelze.

Tags for this Thread

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
  •