taylorkh
Posts: 106
Joined: Mon Nov 20, 2017 7:57 pm

paswordless sudo in Raspbian

Mon Feb 25, 2019 2:37 pm

The Raspbian documentation https://www.raspberrypi.org/documentati ... e/users.md explains how to add a user, make the user a sudoer and optionally to grant them passwordless sudo access. This is consistent with other Linux distros with which I am familiar. My question is...

How/why does the user account pi have passwordless sudo permission? I find no

Code: Select all

pi   ALL = NOPASSWD: ALL
entry in /etc/sudoers.

TIA,

Ken

tpyo kingg
Posts: 809
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: paswordless sudo in Raspbian

Mon Feb 25, 2019 3:03 pm

It's deeper. If you read /etc/sudoers, near the end you'll see

Code: Select all

#includedir /etc/sudoers.d
Confusing as it is, that is not a comment but a call to include the configuration files found in the directory /etc/sudoers.d

There you will find a file named /etc/sudoers.d/010_pi-nopasswd and in that ...

See "man sudoers" and wade through down to where it discusses "Including other files from within sudoers"

taylorkh
Posts: 106
Joined: Mon Nov 20, 2017 7:57 pm

Re: paswordless sudo in Raspbian

Mon Feb 25, 2019 5:19 pm

Thanks tpyo kingg,

That explains it exactly.

Ken

Return to “Troubleshooting”