Score:0

Specifyig executable name in sudoers in order pass password

ca flag

Why has put an executable name in /etc/sudoers, but run it still get asked password?

This is what I have inserted in the file /etc/sudoers by the command $ sudo visudo /etc/sudoers (user name illustrative)

foobar ALL=(ALL) NOPASSWD: /usr/bin/lsblk
$ ls -l /usr/bin/lsblk
  -rwxr-xr-x 1 root root 137168 Jun 27 21:32 /usr/bin/lsblk

But still ask password, how to correct it?

Score:2
it flag

The sudo system doesn't give you the privilege all the time - you must invoke it. Use:

# as user "foobar"
# forget credentials 
sudo -k
#
sudo /usr/bin/lsblk
# and you won't be asked for a psssword
# now, you will be asked
sudo id

Read man sudo

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.