virgosystems Posted June 15, 2022 Share 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 0 Quote Link to comment Share on other sites More sharing options...
schwar3kat Posted June 15, 2022 Share 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 Quote Link to comment Share on other sites More sharing options...
virgosystems Posted June 15, 2022 Author Share 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'? 0 Quote Link to comment Share on other sites More sharing options...
Solution schwar3kat Posted June 15, 2022 Solution Share 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.