Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

331–340 of 439 posts

Re: Sudo for Windows

#331
post #196
post #149

Earlier quoted context omitted.

Look, I'm genuinely curious and we happen to have a MS dev here who could provide interesting first hand insight. I'm not critical. I don't have enough knowledge on the situation to share criticism on the topic yet. I could have added "Could you expand on this?" to clarify my intent.

To answer the original question: I've been at MSFT like, 8 years now? And this is probably the third serious attempt my team has made at Sudo for Windows. (I think I heard of a couple other attempts in my tenure as well). After the last attempt, my mantra had always been "this is impossible to actually ship". It's a tricky feature to ship, cause it is ultimately something that can be used as an escalation of privileg…

You must feel like you just shipped Duke Nukem Forever.

Re: Sudo for Windows

#332

Earlier quoted context omitted.

that's the standard microsoft way embrace (copy sudo), extend (add incompatible options), extinguish

I can say with 100% certainty that Microsoft is not going to extinguish sudo

“Please watch this in-terminal ad while you enter your password”

Re: Sudo for Windows

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

The real question is, where will incidents be reported to if you're not in the sudoers file?

The boring answer would be the event viewer snap-in.

Alternatively, a stern yet extremely polite mail from Raymond Chen asking what you were actually trying to accomplish.

Re: Sudo for Windows

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

the real question is... isn't it pointless if you still get UAC prompt and cannot just log in via CLI?

and what's the point of switching when gsudo basically does the same?

Re: Sudo for Windows

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

What are the common points with Linux, and the differences?

Re: Sudo for Windows

#337

Considering the way PowerShell commands go, I assume this will be: RunWithAllTheElevatedPermissionsPossible --YesEvenThose .\inthisfolder.folder\. grep : The term 'grep' is not recognized....

It's evident that you haven't used PowerShell. Almost all commands in PowerShell have short aliases. For instance, instead of typing 'Get-ChildItem', you can simply use 'gci', which stands for the first letters of each word. Unlike Bash and other shells, where you must learn various Domain-Specific Languages (DSLs) to handle XML, JSON, YAML, etc., PowerShell allows you to use its native language to work with any data…

Hiyo!

Yep, aliases help. Also, verbs are standardized. That example was a bit hyperbolic.

Most of my work is in Linux nowadays, but for me, jq, yq, and other text manipulation software and shell features in bash/zsh will always take a back seat to using the standard commands that ship with PowerShell. I wince every time I see a co-worker using a pipeline full of parse-and-pray greps and awks that is fancy af and amazing, but also, maybe not as nice or consistent as working with objects.

I will say though, you might say "PowerShell is more convenient in many scenarios," not that it's more advanced.

Re: Sudo for Windows

#338
post #7

Earlier quoted context omitted.

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.

you are lucky, where I work WSL2 is blocked for security reasons

WSL 1 is allowed luckily, but it's kinda meh

Re: Sudo for Windows

#339
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?

A link in the article explains ...

https://learn.microsoft.com/en-us/windows/sudo/#how-is-sudo-...

Re: Sudo for Windows

#340
post #67

Earlier quoted context omitted.

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.

Yea, that's a limitation of UAC at this point, and probably not one we can avoid. The "Show details" dropdown on the dialog does however show the commandline you requested, so at least that's one way of making sure it's the thing you ran

From the diagram on the article I see that sudo is elevated first, then the target program is launched.

Can't you call the target program directly? There must be a way, because explorer.exe is not elevated, and when you right click a program and choose "Run as administrator" you get a pop-up for the target .exe, not for Explorer.

Post reply on HN