-
Notifications
You must be signed in to change notification settings - Fork 2k
Incorrect Documentation for requiring sudo Password #4046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As it says in
Yeah, it probably makes sense to rename that to match the username, just for consistency. Is that an easy fix @XECDesign ? |
Ah I see. But I actually tried a reboot and also renamed the file to match my username. But as soon as I do that it has no effect anymore even after a reboot. Sudo won't ask for my password anymore. When I renamed it to match the pi-user again it did have an effect. So I assumed that the mistake is in the name of the file. I will try to reflash the SD card when I am home this evening and try it again. Maybe something on my installation is just broken. |
Seems to be working as expected for me? I've set things up as you've described, and I get asked for a sudo password after a reboot: pipi@raspberrypi:~ $ ls -l /etc/sudoers.d/
total 24
-r--r----- 1 root root 36 Apr 29 2019 010_at-export
-r--r----- 1 root root 44 Jun 19 2024 010_dpkg-threads
-r--r----- 1 root root 31 Jul 25 2023 010_global-tty
-r--r----- 1 root root 27 Mar 12 10:52 010_pipi-nopasswd
-r--r----- 1 root root 211 Mar 18 2022 010_proxy
-r--r----- 1 root root 1096 Jun 27 2023 README
pipi@raspberrypi:~ $ sudo cat /etc/sudoers.d/010_pipi-nopasswd
[sudo] password for pipi:
pipi ALL=(ALL) PASSWD: ALL |
So I also tried flashing the image again. The file is still named But then the documentation is still wrong IMHO because the file that the system created is not called |
Fix for what and consistency with what? The file belongs to a package, so renaming it would be a bad idea. Since the filename has any relation to the username, I don't see the value in tinkering with it. |
The file currently created by the system has no relation to the actual username. It is always named the same way on my fresh install of Raspberry Pi OS Lite.
Not like the documentation mentions it. |
Yup, you're right about all of that, and the documentation needs to be fixed. I was just responding to whether the OS should be changed to match the documentation. |
Ah sorry I read your message wrong. Then we have the same understanding of what the issue is. |
Ahhh, sorry @XECDesign , I didn't realise that the file belonged to a package, rather than "just" being automatically created at first boot 🤦 @masselmello As we're all in agreement, would you like to submit a PR with the appropriate change to the documentation? |
@lurch Sure |
In the documentation for requiring a password for sudo commands it mentions that I have to edit the
010_<username>-nopasswd
file by adding this line:<username> ALL=(ALL) PASSWD: ALL
The issue is that my installation does not have this file. Instead I have a file called
010_pi-nopasswd
. This already has the following entries:<username> ALL=(ALL) NOPASSWD: ALL
To my understanding this should not be the case according to the documentation. The file should not have the pi user name in it but the username of the user that I created when flashing the image with Raspberry Pi Imager.
The username I created is definitely very different to "pi".
If I change the values in the
010_pi-nopasswd
file to<username> ALL=(ALL) PASSWD: ALL
it works as intended and requires me to type my password for sudo.But if I delete the
010_pi-nopasswd
file and instead add the correct file010_<username>-nopasswd
with<username> ALL=(ALL) PASSWD: ALL
as it's content, then I still do not need to type my password for sudo. It has no effect.Is this a mistake in the documentation and the file should still be called
010_pi-nopasswd
and not010_<username>-nopasswd
or is it a bug in the current Raspberry Pi OS Lite?Here a screenshot of the documentation for quick reference:
The text was updated successfully, but these errors were encountered: