Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

211–220 of 439 posts

Re: Sudo for Windows

#211

Earlier quoted context omitted.

Seems like a horribly convoluted way to manage permissions. Also I have never heard anyone suggest you shouldn't use a local admin account. That's the exact problem UAC was meant to solve. Having used an unprivileged Windows account, all I can say is no thanks. It's a huge burden if you do anything even slightly more complex than Facebook and email. As a blanket policy at work, all programmers are admins, everyone el…

Nobody does what you describe. When someone has a genuine need for local admin access, they are given two accounts - an unprivileged account to log in with, and a privileged account to enter into UAC when needed. It would indeed be an unbelievable waste of time to make your IT staff sit next to users to enter admin credentials, which is why nobody does it. And for the record, "don't log in with a local admin account"…

> Nobody does what you describe.

Counterpoint: I've never heard anyone do what you describe. Therefore no one does it, even though you've just described to me who does.

What exactly is the threat in using a local admin account? I can't think of anything you could do that wouldn't show a UAC prompt. The entire point and purpose of UAC was to prevent malicious elevation without the user's knowledge. I'm really not sure what you accomplish by adding a password to UAC prompt the user wouldn't have read either way. The end result is the same.

Re: Sudo for Windows

#212
post #2

Yep, it's really happening. Sudo is coming to Windows. It's obviously not just a fork of the linux sudo - there's enough that's different about the permissions structure between OS's that just a straight port wouldn't make sense. But the dream of being able to run commands as admin, in the same terminal window - that's the experience we're finally bringing to users. I've been working on this for the last few months n…

Why don't you guys just use a regular shell? People just want a unix like command line. Windows seems to be doing a lot of work to avoid this.

Re: Sudo for Windows

#213
post #137

Earlier quoted context omitted.

They've done it with curl: they made an alias to their own program not supporting the same feature set and it inevitably backfired [1]. sudo is a complex program with a lot of different options [2] and as people from MS said here, it's never going to be compatible because of how Windows works differently. While I understand picking a familiar name, sudo is certainly not the only player, there's also doas. This shows…

> sudo is certainly not the only player, there's also doas. This shows people can adapt to another name The fact that doas has far fewer users, and examples everywhere show `sudo xyz` as the way to run xyz as root, shows that people do not adapt to a different name. Microsoft has been trying, for years, to get developers to use Windows systems. This is another good step towards doing so. The answer isn't to use a dif…

>The answer isn't to use a different name; the answer is to actually support most of the sudo interface.

The answer is to do either.

i.e. the complaint about using the name while offering a different, incompatible interface is valid.

Re: Sudo for Windows

#214
post #73

Earlier quoted context omitted.

Windows NT linage has supported UNIX since day one. While the original support wasn't great, SUA was quite usable, until they decided to discontinue it on Windows Vista. Nowadays we have WSL, which makes more sense, given how many folks buy Apple hardware and then complain UNIX isn't GNU/Linux.

> Windows NT linage has supported UNIX since day one. yes, that's why the attempt to provide a Linux subsystem on top of the NT kernel (WSL1) was so successful they abandoned the approach entirely WSL2 runs the full Linux kernel in a sidecar VM

Also known as, you don't know technically anything about Windows.

There is a very big difference between supporting UNIX, and Linux kernel syscalls ABI on top of pico processes, the technology from Drawbridge kernel taken out from Microsoft Research, which incidentally is also used to port MS SQL Server into GNU/Linux.

Re: Sudo for Windows

#215

Do caffeinate next! That reminds me, I have a half-written implementation here: https://github.com/AustinWise/caffeinate

I've been using this (https://learn.microsoft.com/en-us/windows/powertoys/awake#co...) on my work computer for a few months and it works similarly to caffeinate.

Re: Sudo for Windows

#216

Earlier quoted context omitted.

I'm really amused that the least painful way to develop for Windows on Windows is to just use Linux.

> the least painful way to develop for Windows on Windows is to just use Linux Eh? Even as a joke, I don't get it. 1. Download Visual Studio 2022 Community Edition 2. Select and install the workloads you need 3. Fire up any boilerplate from the Welcome menu 4. Press the green play button Sure, it's no `pacman -S base-devel && g++ main.cpp && ./a.out`, but it's not as bad as everyone puts it. It is a GUI-first operati…

Replying to

> All MS is trying to do [with WSL] is make it easier for developers to develop on Windows for Windows, which it has ample incentive to do both internally and externally.

> if you want to write a fast, HiDPI-aware Win32 application today that supports everything from Windows XP to Windows 11 that's I said "least painful", not impossible. The scenario you describe here would be very painful.

Re: Sudo for Windows

#217
post #71

Earlier quoted context omitted.

"In this configuration, Sudo for Windows will open a new elevated console window and run the command in that window. This is the default configuration option when sudo is enabled"

That's the default option but you apparently can still run the elevated command in the current window if you want.

Just like when using runas.

https://learn.microsoft.com/en-us/previous-versions/windows/...

Re: Sudo for Windows

#218
post #107

Earlier quoted context omitted.

The best way would be, if it could say something like: Allow $PARENT_PROCESS_NAME to run $COMMAND with administrator rights. So if you would enter the following in cmd.exe: sudo notepad.exe ... It would say: Allow Command Processor Shell to run notepad.exe ... with administrator rights.

Maybe for Windows 2025 we can work with the UAC folks to get something like that. I'm still shocked to this day that we managed to ship this at all. One step at a time :)

I wish my fellow posters could get out of their own way long enough to congratulate you! this is a great feature. I'm glad you got it into the build and I can tell you're excited about it. I can't remember the last time. I was excited about a feature that I shipped. maybe I'm just burned out but it's really refreshing to see it's shining through your replies. companies like Microsoft and Google need more engineers like you that actually care about shipping cool shit.

Re: Sudo for Windows

#219
post #133

Earlier quoted context omitted.

A tool like sudo should probably be sufficiently integrated with UAC to be able to customize that dialogue box...

You say that like Microsoft isn't an incredibly deeply dysfunctional company with absurd turf wars and conflicting interests between all the teams. You'd think it should be sufficiently integrated, but it's likely office politics made that impossible. How about be glad we got this at all as a first step, then maybe it will build momentum towards a better integrated solution?

[dead]

Re: Sudo for Windows

#220
post #213

Earlier quoted context omitted.

> sudo is certainly not the only player, there's also doas. This shows people can adapt to another name The fact that doas has far fewer users, and examples everywhere show `sudo xyz` as the way to run xyz as root, shows that people do not adapt to a different name. Microsoft has been trying, for years, to get developers to use Windows systems. This is another good step towards doing so. The answer isn't to use a dif…

>The answer isn't to use a different name; the answer is to actually support most of the sudo interface. The answer is to do either. i.e. the complaint about using the name while offering a different, incompatible interface is valid.

Yes, I agree.

I do think it was correct to use the name, though, which means they should be more compatible.

Post reply on HN