I'm becoming increasingly concerned with the relaxed effort I'm getting from sudo. In a VM im testing WSL. The VM is just for the windows guest, so I can see what I can access with WSL, and what I can break. What concerns me is that I've noticed upon opening a shell a few times that sudo su does not ask me for my password. Here's an example of 5 concurrent shells 3 from BoUoW and 2 from cmd.

enter image description here

They are ordered in the order they were run. Notice the first two, which completely bypass the password phase. I'm root. that's it. No hacks required. No shells were open apart from these. The first two sent me directly into root. Then suddenly it starts to ask me for it again.

Some notes:

  • The number of unprotected terminals varies, sometimes I can directly access root once, sometimes 6 times before it starts asking.
  • System reboot is completely independent. Rebooting does not greet me with a guaranteed password protected root shell.
  • Once the password protection starts to kick in, I have not noticed it stop. Unless all terminals are closed. Process repeats.

Another strange case is that while the terminal gives me root access, I can type su nalaurien to get from root to nalaurien. But then it askes for a password. After it also again asks for a password to go back from nalaurien to root.

If sudo su asks for a password to get to root, I require no password to su nalaurien back. Does anyone have any insight into this one?


btw fixed the issue where bash was screaming at me that it couldn't resolve my host. Stated problem still exists.

  • Two notes: (1) You may want to fix the "Unable to resolve host" message maybe starting reading here; (2) If I've correctly understood you "The VM is just for the windows host" should be "windows guest". Please clarify however your system configuration, it will help the readers. Good Luck.
    – Hastur
    Commented Jun 18, 2017 at 8:08
  • @Hastur Thank you yes, I meant guest. The host issue is just because WSL does not attribute the hostname to the localhost ip in /etc/hosts. I don't think it's related to this though. But I'll give it a shot anyway.
    – Nalaurien
    Commented Jun 18, 2017 at 8:19

1 Answer 1


Might be related to sudo credential caching on by default - check and try to edit the sudoers file to change this behavior.

  • This answer led me in the right direction, it seems that WSL creates such a cache file during the first install for pid2, which is what the first console is spawned as. If you use the console right after install it can appear as though sudo has no security. Which is what threw me off. Everything else built from there.
    – Nalaurien
    Commented Jun 21, 2017 at 5:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .