WSL icon indicating copy to clipboard operation
WSL copied to clipboard

No sudoer's password prompted after reboot

Open lateau opened this issue 10 years ago • 2 comments

Reproduce:

$ sudo su -
# rm /init         # I don't know this related to no sudo password.

And reboot and launch first Bash via start menu.

$ sudo ls   # no password prompt
my files directories here

Launch second Bash.

$ sudo ls
[sudo] password for lateau:

Reboot again. Launch Bashes. Only first Bash does not prompt sudo password.

lateau avatar Jun 08 '16 16:06 lateau

When you run sudo and provide a password there is a configurable timeout before you are prompted to type your password again. See this page for more info. Sudo modifies a file with a change timestamp, and does a stat each time "sudo" is run to detect if the user needs to supply their password. What's happening in your above repro is you've rebooted your machine and re-launched bash within this timeout window.

I assume boot or login usually clears these timestamps, but we're not running those binaries. I'm inclined to resolve this as by-design since we don't run login or the Ubuntu init process but I'm open to hear your thoughts.

benhillis avatar Jun 09 '16 18:06 benhillis

Closing this out as by-design.

benhillis avatar Jun 20 '16 16:06 benhillis