Bugzilla – Bug 700
Why a password challenge on "sudo -l"?
Last modified: 2015-06-17 09:20:14 MDT
A user wants to check what sudo rights they have on a system. They enter the command "sudo -l", and if they have any granted rights, they are listed out, and the program exits. But, if they have no specifically granted rights, sudo prompts the user for their password. Why the password prompt, instead of just saying that the user has no elevated rights?
"sudo -l" requires a password so that it is not possible for someone else to see a user's privileges in case there is an an unattended terminal (e.g. in a lab setting with multiple people). If you want to allow "sudo -l" with no password you can just use the following in sudoers: Defaults listpw=never Users with sudoers privileges don't need to enter a password if they've used sudo within the past 5 minutes or if their privileges don't require a password to be entered.