You are not logged in.

#1 2014-10-03 22:15:17

prakharsingh95
Member
From: Roorkee
Registered: 2014-10-02
Posts: 33

How to set up sudo with confirmation but NOPASSWD?

First of all, I researched and I am not talking about just the NOPASSWD option in /etc/sudoers.

Here's my /etc/sudoers file (partial):

root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo	ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d

(I have obviously added myself to wheel).

Now if I use the NOPASSWD option, sudo works without a password, as expected. However, even if I run a normal program, like yaourt, it automatically gives it sudo permissions (I'm guessing that's because it's running with my uid). For example, I can run 

yaourt -Syu --noconfirm

and update packages, no confirmation at all.

What I want is for sudo to ask for a binary confirmation prompt, instead of a password.
How do I set it up that way?

Last edited by prakharsingh95 (2014-10-03 22:15:57)


A person who never made a mistake never tried anything new.

Offline

#2 2014-10-04 08:42:45

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 456

Re: How to set up sudo with confirmation but NOPASSWD?

all your lines are commented. ?

ezik

Offline

#3 2014-10-04 09:10:03

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: How to set up sudo with confirmation but NOPASSWD?

yaourt most probably runs "sudo pacman", in case you weren't aware of that.

Offline

#4 2014-10-04 16:21:17

prakharsingh95
Member
From: Roorkee
Registered: 2014-10-02
Posts: 33

Re: How to set up sudo with confirmation but NOPASSWD?

shulamy wrote:

all your lines are commented. ?

ezik

%wheel ALL=(ALL) ALL <<< Nope.

lucke wrote:

yaourt most probably runs "sudo pacman", in case you weren't aware of that.

That's sort of the problem. When yoaurt runs sudo pacman, it gets superuser without me knowing. Any script I run will get superuser just by using sudo. I want sudo to ask for my permission, but not my password (fingerprint actually) over and over again.


A person who never made a mistake never tried anything new.

Offline

Board footer

Powered by FluxBB