1

I'm playing around with the bash shell for Windows 10 and I noticed that I was in the root mode (whoami returns root). I'm still fairly fresh at bash but I know enough to know that using root mode is dangerous if you don't absolutely know what you're doing (like me).

exit and Ctrl+D don't work.

Any tips to log out of sudo?

EDIT: I created a new user account with adduser and it took me out of root mode.

6
  • What happens with Ctrl-D and exit? Also, add the output of env, please. Commented Oct 16, 2017 at 13:30
  • There was no output. The window would just close. I think what was happening was that there was no user in the system so it defaulted to the root. I added a new user and it took me out of root and into that user mode so I think I'm all good now Commented Oct 16, 2017 at 13:39
  • 1
    You should use "@" followed by username to reply to someone, for example @muru Commented Oct 16, 2017 at 13:43
  • @HughO'Brien oh. The default user of WSL unless you created one is indeed root. Root on WSL != Administrator on Windows, so you can't do any real damage using it. Commented Oct 16, 2017 at 13:44
  • You must change the default user for the WSL bash. In a Windows command line, LxRun.exe /setdefaultuser <new_name> Commented Oct 16, 2017 at 15:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.