microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.47k stars 822 forks source link

Kerberos, automatic user #1573

Open ehartford opened 7 years ago

ehartford commented 7 years ago

I want the WSL to automatically make a unix user for my windows user, (kerberos) and I want it to automatically log me in as that user unless I specify otherwise.

I want my WSL home directory to be my Windows user home directory (just like cygwin, mingw)

So I can share my ~/.ssh/config and ~/.vimrc etc

I just don't want to be exposed to the idea that "WSL has separate users" unless I want to be.

sunilmut commented 7 years ago

@ehartford - Good ideas and thanks for the feedback. We appreciate it. Because, there is more feature requests than the bandwidth, we have to prioritize the work for the future. We do that by looking at our user voice page. Please head out there and open a new ticket (if there is not one already) for this and when it reaches critical mass (of votes), it will be hard to resist for us. And, please keep the feedback coming.

thorsteneb commented 7 years ago

I want my WSL home directory to be my Windows user home directory (just like cygwin, mingw)

I'm not sure how awesome that would be. The Windows file system is handled less "Linuxy" than the WSL file system, see https://msdn.microsoft.com/en-us/commandline/wsl/faq

As a result, building from source from within /mnt/* is bound to fail, where it works in ~/ or /var/tmp. Sure, I could stop working in ~/, but I actually like being able to use, say, rakudobrew in there.

therealkenc commented 7 years ago

NTFS is a little more Linuxy now that Microsoft has come to a point of acceptance (after 20 years) that symlinks are a thing. I'm holding out hope this continues to improve; especially if the intent here is to pry the MacBooks out of millennial developers' cold dead hands. By 2037 Microsoft may even come to accept that unlinking file objects with open handles is also a thing.

fpqc commented 7 years ago

@therealkenc Do they have a reason for keeping that behavior (locking files with open handles)?

I remember in the bad old days of Win7 I had to use a tool called unlocker to find what processes had open handles on files when they wouldn't clear properly. It was mostly a hindrance. I've had fewer problems nowadays with Win10 thankfully, but it would be nice to be able to unlink as you say.

thorsteneb commented 7 years ago

@therealkenc Sure, we have symlinks now. Having two files that differ only in case is not supported on NTFS, and I don't see it happening. Chown and chmod raise real questions, because that's not how NTFS works. NTFS has ACLs while *ix has always maintained that owner/group/everyone is good enough for any use case.

Seeing the additional complexity with very little gain, I'd really rather have my Ubuntu ~/ on VolFS, not FileFS, the way it is now.

You say you want .ssh and .vimrc to travel. Any reason you couldn't designate the copy on /mnt your master copy, have a few lines in .bashrc that copy them over (*), and only ever make changes to the files in /mnt?

(*) If you want to use the same .bashrc in both environments, you can detect WSL by looking at /proc/version.

aseering commented 7 years ago

@yorickdowne :

thorsteneb commented 7 years ago

@aseering Thanks! Always good to learn new things. My main point remains though: What a pain to deal with all that when the goal is just to not have two copies of .ssh. Syncing that directory by whichever means seems so much simpler.

ehartford commented 7 years ago

that's not the goal... It's having one profile, the .ssh was just an example. also not having to worry about multiple users, unless that's actually something I care about. Look, it's Windows not Linux. There are expectations. Things should "Just Work" without fiddling.

thorsteneb commented 7 years ago

@ehartford I'll be that guy who says "we'll have to agree to disagree".

I want the WSL to automatically make a unix user for my windows user, (kerberos) and I want it to automatically log me in as that user unless I specify otherwise.

It kinda does that now. Minus the sudo password, noted. I'm not sure how to get around that short of having WSL use the same kind of hash that Windows uses. I'm not sure how Linux-y that would be. Clearly Windows doesn't have my plain text password, so it can't re-hash it for WSL without my entering it. I do want sudo, that's integral to how Linux behaves.

I want my WSL home directory to be my Windows user home directory (just like cygwin, mingw)

We've discussed that. For all the reasons already given, please no. I LIKE that I can build Linux stuff from source. I like that I can use Linux binaries and expect them to work. And that is made so much easier by ~/ being VolFS.

Look, it's Windows not Linux. There are expectations. Things should "Just Work" without fiddling.

That sounds reasonable yet:

If you're not using it for dev, maybe Powershell would be a better option?

aseering commented 7 years ago

Linux supports plugfable authentication these days. Someone (doesn't really even need to be someone at Microsoft) could write a PAM module that passes the raw username and password to Windows for validation.

For what it's worth, I think I do personally favor using users' Windows home directories as their Linux home directories as a long-term plan. The status quo has been the source of all kinds of confusion, often from devs who want to use Windows and Linux tools simultaneously. But not today. As noted, too many things would break if the switch were made right now.

therealkenc commented 7 years ago

Turns out (as with most things WSL) someone already has for native. It would probably need some adaptation to feel at home on Windows, and I haven't made the effort to work up a demo yet though.

jouhoff commented 2 years ago

Quiet late, still I used to Auto-it things like this. Reduced reliance on more third party solutions and you got a grip on it yourself.

Tldr, Power-automate is amazing for small glue handcrafts.

Cheers!

TheJayMann commented 1 year ago

Something I've just tried that appears to work, though more of a workaround than a solution, is making use of the ms2mit utility available in MIT's Kerberos for Windows distribution. By specifying -c ccache (in my case, I just did -c FILE:ccache), then specifying within WSL the environment variable KRB5CCNAME to use the same file, I was able to make use of GSS-API in WSL using the tickets already created in Windows. The only testing I've done was using curl against an Azure DevOps Server, which worked without issue.

Edit: I've further tested LibreWolf (FireFox) as an app image, setting up negotiate auth trusted uris, and it also worked properly when loading the Azure DevOps Server home page, as well as other websites using Windows Integrated Authentication.