User accounts under WSL (Windows Subsystem for Linux)

2

3

I have noticed while browsing the Windows blog for information about the latest Insider Preview release (Build No. 14316), that the bash when installed gives you a root prompt by default. Notwithstanding security issues like rm -rf C:/ (WSL supports Windows filesystem access), can the sudo behavior of the Ubuntu 14.04 LTS base not be replicated by default, as in, bash gives you a user-level prompt on startup and you can then sudo to root as and when you need it?

Does root map to Administrator or System? Also, what is the expected behavior of chmod and chown under these circumstances? Do the Windows users and groups get directly reflected to the Ubuntu base through WSL, or is there something in between?

Tamoghna Chowdhury

Posted 2016-04-08T05:06:37.163

Reputation: 153

Answers

2

Do the Windows users and groups get directly reflected to the Ubuntu base through WSL, or is there something in between?

My understanding after watching the two videos about this feature when it was announced a week ago was that nothing like that is currently implemented. Remember that this environment is intended to run as an application and every user on the system has her/his own copy. So you are free to do what you want. At the moment the functionality is simple and you should only be able to access files from inside the environment that you have permissions for in Windows.

Future versions are likely receive improvements so that when you do a fresh install of the environment it will log you in as a normal user, sudoers for example doesn't seem to be properly configured at the moment.

Notwithstanding security issues like rm -rf C:/ (WSL supports Windows filesystem access)

The correct path is /mnt/c/ (other drives or network resources were not mounted at the time), so I just ran rm -rfv /mnt/c/ and received a lot of error messages that I am not authorized to modify files in system directories like System32, but it did delete files in my user directory. Remember that a recursive option for a command is not a "security issue", a user with too many permissions who does not understand or care about commands and options to a degree where s/he chooses safer options is the actual "security risk", at least with regard for their own data.

LiveWireBT

Posted 2016-04-08T05:06:37.163

Reputation: 737

So the root login refers only to the current user? – Tamoghna Chowdhury – 2016-04-08T08:33:55.863

Dumb question previously. So 1 Windows user can spawn more Linux child users via adduser for example (if that has been implemented?) – Tamoghna Chowdhury – 2016-04-08T08:35:16.407

@TamoghnaChowdhury - Seems like something you should verify if its the case or not. – Ramhound – 2016-04-08T12:29:54.853

@Ramhound Unfortunately I'm not old enough to be a legitimate Windows Insider :( – Tamoghna Chowdhury – 2016-04-08T13:30:46.370

@TamoghnaChowdhury - Its not like the Windows police will come to your door. Unless you actually tell Microsoft that is the case they won't actually know. – Ramhound – 2016-04-08T13:36:15.043

@Ramhound Very well. I'll try it as and when I get the opportunity. – Tamoghna Chowdhury – 2016-04-08T13:37:43.820

Yes adduser or Debian's useradd work and you can switch to the new user with su <username>. I just tried it. – LiveWireBT – 2016-04-08T13:43:57.143