Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

311–320 of 439 posts

Re: Sudo for Windows

#311
post #26

Earlier quoted context omitted.

Does the UAC prompt always say "Verified publisher: Microsoft"? Even without controlling stdin, malware at medium integrity could prompt to run a malicious command, and users will only see Microsoft's good name in the popup. Does this elevate within your own account token (i.e. will not work for non-Administrator users), or does it actually switch user (e.g. to LOCAL SYSTEM)?

Putting Microsoft in the UAC prompt is indeed weird. It should be the info of the target binary. This feature sounds a bit rushed, and it's early preview, maybe they fix it by the final release.

Yes, but then you would just run sudo cmd.exe [the program you want to run] and it will still say Microsoft.

Re: Sudo for Windows

#312
post #261

Here's hoping that "Windows 12" will be just a Window manager + Desktop running on Linux, with all existing bugs meticulously replicated to maintain backwards compatibility with Windows 95/7/8/10/11.

Stop dreaming. Won't happen. Windows is a purely additive effort. WSL is what happened, and when it couldn't do some things they built WSL2.

As another commenter pointed out regarding the integration of this new "sudo" and UAC prompts, it will probably be done in a new, separate, different tool, because this new, freshly released "sudo" will now have to remain bug-for-bug compatible for the next four decades.

Re: Sudo for Windows

#313

This smells like when PowerShell aliased curl and wget to a completely different command, with incompatible arguments. https://github.com/PowerShell/PowerShell/pull/1901

Yes terrible move which will lead to much confusion and consternation in the future.

But honestly I'm most amazed by the fact that there wasn't previously a way to run commands with elevated permissions in Windows. How did people work like that? Just run everything in an admin terminal super unsafely?

Re: Sudo for Windows

#314
post #313

This smells like when PowerShell aliased curl and wget to a completely different command, with incompatible arguments. https://github.com/PowerShell/PowerShell/pull/1901

Yes terrible move which will lead to much confusion and consternation in the future. But honestly I'm most amazed by the fact that there wasn't previously a way to run commands with elevated permissions in Windows. How did people work like that? Just run everything in an admin terminal super unsafely?

You have to think about what terminal you need before opening it. I rarely need an admin terminal. That software is often installed by downloading and double click helps as that cuts out the command line. Devops is tricky though! You sometimes have to spawn other processes to get the elevated permissions.

Re: Sudo for Windows

#316
post #214

Earlier quoted context omitted.

> 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.

who cares? they still abandoned it

because it didn't work

Re: Sudo for Windows

#317
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…

It seems interesting to me that Windows integrates more and more elements of Unix.

Linux is open source and free, Apple develop an OS that sells specific hardware, and historically Windows has sold the software for generic hardware. Windows is unlikely to become a better Linux than Linux. Where is Microsoft's new business model going?

Historically Office was a money maker, but Office online is a shambles and many users interact with Office via this interface - I see Office slowly dying in favour of open source options. I see Windows licenses being sold less and less in the future. Microsoft Lens is essentially buried at this point. There are the Surface laptops/tablets which are good but not special. Dedicated games console hardware will likely become less attractive as they slowly become glorified desktop PCs.

I don't see Microsoft with big user shares in the software or hardware industries? There were a few good purchases such as Minecraft, GitHub (+), etc [1]. Is there something I'm missing?

[1] https://en.wikipedia.org/wiki/List_of_mergers_and_acquisitio...

(+) GitHub's new security model is outright hostile - to the point I no longer want to use it.

Re: Sudo for Windows

#318

Earlier quoted context omitted.

Already there. Windows has had services for a long time managed pretty similarly to systemd/launchd.

Well, compare how to start syncthing automatically on Windows: https://docs.syncthing.net/users/autostart.html On Debian I could just type: systemctl --user enable --now syncthing.service Native systemd on Windows would be awesome. Microsoft should hire the creator of systemd...

There's sc[1] on Windows for this, though many services can do it themselves, eg

    myservice.exe /install
Of course, the application must support the service interface[2] to do this, which is like providing the .service file for systemd.

The key difference is that it's built into the application[3] in Windows, not external like with systemd, which has pros and cons.

[1]: https://learn.microsoft.com/en-us/windows-server/administrat...

[2]: https://learn.microsoft.com/en-us/windows/win32/services/ser...

[3]: https://learn.microsoft.com/en-us/windows/win32/services/ser...

Re: Sudo for Windows

#319

Earlier quoted context omitted.

It’s not Unix shell inspired at all, that’s the problem.

Oh it is, just in all the worst ways. I mean look at this: $value = 10 if ($value -eq 10) { Write-Host "Value is exactly 10." }

At least it doesn't let you do this (as far as I can tell) so it seems slightly better in that aspect:

  value="1 -o 1"
  if [ $value -eq 10 ]; then
    echo "Value is exactly 10."
  fi
The syntax is terrible, though – if these operators are not actually options for a command, which is the context where the leading dash makes some kind of sense, why make them look like that?

Also, why does the documentation[0] talk about statements returning values? I've never seen the terminology used that way before. Usually expressions evaluate to a value and statements can consist of an single expression.

[0] https://learn.microsoft.com/en-us/powershell/module/microsof...

Re: Sudo for Windows

#320
post #313

Earlier quoted context omitted.

Yes terrible move which will lead to much confusion and consternation in the future. But honestly I'm most amazed by the fact that there wasn't previously a way to run commands with elevated permissions in Windows. How did people work like that? Just run everything in an admin terminal super unsafely?

You have to think about what terminal you need before opening it. I rarely need an admin terminal. That software is often installed by downloading and double click helps as that cuts out the command line. Devops is tricky though! You sometimes have to spawn other processes to get the elevated permissions.

I guess the reason it strikes me as strange is, on linux the usage of `sudo` helps you understand which operations might be dangerous in a fine-grained way

So like if you are executing a series of commands, the one requiring admin privileges tends to be one you might want to be more careful about (i.e. altering system configs, or doing a potentially insecure operation)

So if you are running everything in an admin terminal, it seems like you wouldn't have that extra check to remind you to be extra mindful of a particular operation, since everything you do in that terminal is in the same bucket

Post reply on HN