virgosystems Posted June 15, 2022 Posted June 15, 2022 (edited) Not that I ever got this working correctly on Raspbian, but how do I go about requiring a password for sudo? I am able to change the password via 'sudo passwd' without error, but I still don't know how to make the system request the password every time I sudo. Thanks so much Joe Edited June 15, 2022 by virgosystems formatting
schwar3kat Posted June 15, 2022 Posted June 15, 2022 Sudo users by default supply their own password for authentication, rather than the password of the target user. After authentication, and if the configuration file (typically /etc/sudoers) permits the user access, the system invokes the requested command. https://en.wikipedia.org/wiki/Sudo. When you ran the command 'sudo passwd', you were changing the password for the root user, not the user invoking sudo (you were acting as root when you changed the password). 1
virgosystems Posted June 15, 2022 Author Posted June 15, 2022 Right, I got that far. My point is, how do I make the OS require that I enter password every time I 'sudo foo'?
Solution schwar3kat Posted June 15, 2022 Solution Posted June 15, 2022 Close the session or use sudo -k which forces a time out. More info in this link https://askubuntu.com/questions/1195719/how-do-i-force-sudo-to-ask-for-a-password-each-time-when-a-specific-command-is 1
Recommended Posts