Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

181–190 of 439 posts

Re: Sudo for Windows

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

I think they should've named it something else to avoid confusion, especially if it doesn't have the same behavior as unix sudo. If it has different arguments and features, imagine the confusion of unsuspecting users searching how to use sudo in the future.

> imagine the confusion of unsuspecting users searching how to use sudo in the future.

Linux users can experience this now by using sed on macOS

Re: Sudo for Windows

#182
post #164

Earlier quoted context omitted.

This doesn't mean this isn't an issue, and that the issue should be worsened. Of course, it being an issue is an opinion (of mine), see my daniel.haxx.se link from my other comment next to yours for a motivation of this opinion.

The situation with curl is different because these are unix utilities you can run on Windows (hence the issue). Now "sudo" is not a very Windows-y name for this utility but it has the advantage of being self-descriptive by those most likely to use it. It's sudo... for Windows. You don't have to explain it further. The command line namespace is flat and there are only so many letter combinations, the idea that an OS s…

> The situation with curl is different because these are unix utilities you can run on Windows (hence the issue).

Good point, the unlikeliness to ever run the real sudo on Windows makes it less an issue. Though doesn't remove it completely. You could for instance imagine a bash script (which you can run on Windows, since you can install Bash there) trying to use sudo if present, or something else, and fail because sudo is present but doesn't have the expected features. In shell land, the name of a command is almost an implicit contract.

> The command line namespace is flat and there are only so many letter combinations, the idea that an OS shouldn't reuse a command name from a different OS is pretty limiting.

In practice:

- Programs are mostly cross platform so many "commands" can work on different OS. Which makes the command line namespace quite shared between OSes

- I've not seen many clashes. I can certainly remember of one: the Chromium browser and the Chromium B.S.U game. It was unintentional. The "sudo" one is. You can certainly avoid it.

Re: Sudo for Windows

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

Does this mean that I can run PSWindowsUpdate in a remote PowerShell session? If so, this is going to save me a lot of time. Also, AD management tools never work vie Enter-PSSession. Will stuff like that work as well?

Re: Sudo for Windows

#186
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 can't you do this with the tool that already exists to do the exact same thing, called runas?

And if you need the Sudo interface there are wrappers like https://github.com/purplesyringa/win-sudo.

If the elevation prompt would show the elevated executable and not the wrapper, that would be news...

Re: Sudo for Windows

#187
post #7
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…

Nice to see the author here! I have to say: I really like whats going on in Windows world from a developer perspective in the recent years. I am a hardcore Linux fanboy for decades but I have to admit that PowerShell, WSL, vscode, Windows Terminal and the recent open source strategy sounds very appealing to me. This is something MS/Win does much better in recent days compared to, for instance, Apple/Mac OS. I would l…

I use WSL2 a lot because my current employer is a "Microsoft" shop (despite all the code being deployed in Linux containers).

For us developers, the changes in Windows to support WSL2 weren't really an enhancement of Windows, it's now just a really complicated way to run Ubuntu. As in, Windows 11 is the biggest Linux bootloader in history.

sudo for Windows...can't even see a use for it any more.

Re: Sudo for Windows

#188
post #133

Earlier quoted context omitted.

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?

[flagged]

Job security for us Microsoft MVPs

Re: Sudo for Windows

#189

Earlier quoted context omitted.

Why is admin privilidge even a thing? Ask for the god damn specific resource you want access to and I'll answer yes or no!

"Admin"'s identity is the resource you're asking permissions to use. If don't want identities, are you going to manually authorize every file that needs to be interacted with? For a recursive delete of thousands of files?

You would authorize deletion in a specific directory.

Re: Sudo for Windows

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

I haven't seen anyone ask the important question: Is the mascot coming along for the ride?

https://www.reddit.com/r/linuxmasterrace/comments/u4xeoy/in_...

Post reply on HN