Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

191–200 of 439 posts

Re: Sudo for Windows

#191
post #137

Earlier quoted context omitted.

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.

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 different name; the answer is to actually support most of the sudo interface.

But that said, there's a subset of the sudo interface that would cover the majority of what most people need on a regular basis:

-H (change home directory)

-i (act like a login shell, which may not be meaningful on Windows but could at least be ignored for compatibility)

-E (preserve the environment)

-u (set the user to something other than root)

-g (set the group)

-s (just run a shell)

Re: Sudo for Windows

#192

Well, sudo for Windows has been a thing for, like, a few years now?... https://github.com/gerardog/gsudo Not sure if this is the same thing, but this definitely should have shipped with the very first implementation of "oh, sure, you're an Administrator, but not really, since we're ignoring that bit" a.k.a. User Account Control. That would have saved about a metric ton of misguided "here's how to turn off UAC" tutori…

The blog post links gsudo right at the top:

> If you’re looking for additional functionality that Sudo for Windows does not provide, check out Gerardo Grignoli’s gsudo which has a number of additional features and configuration options.

Re: Sudo for Windows

#193

Earlier quoted context omitted.

Only problem is Powershell's commands are abysmally slow in comparison to chaining together Linux terminal commands that are written in C. Powershell is a super neat language though.... especially if the Microsoft team that manages it would work more with the team that does more for SMEs and not just DevOps. The overwhelming majority of windows users doing regular business work have to deal with crufty stuff like VBA…

Powershell is a terrible "language". It's fine for sysadmins to do sysadmin work but why would you want to subject business analysts to that level of unix shell inspired weirdness. Microsoft already has VB.NET which would serve that market much better. Give me C# over PS any day.

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

Re: Sudo for Windows

#194
post #43
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…

Thanks! I think the team we're on has a very clear focus on making developers happy. Like, we're all ourselves, developers, so a lot of it is very self-serving. Anything we can do to make our own lives better is probably going to be a good thing for a lot of other developers too.

Shame the rest of the company is dedicated to making users unhappy to scrounge a few extra pennies. Users include developers of course.

(See the transcript of Security Now 958 for recent details.)

Re: Sudo for Windows

#195

Earlier quoted context omitted.

Powershell is a terrible "language". It's fine for sysadmins to do sysadmin work but why would you want to subject business analysts to that level of unix shell inspired weirdness. Microsoft already has VB.NET which would serve that market much better. Give me C# over PS any day.

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

Re: Sudo for Windows

#196
post #149
post #135

Earlier quoted context omitted.

Sorry, have you never read anything about Microsoft before? I'm not sure why people are being so critical of OP.

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 privilege vector. Like, that's the entire idea. And there are a lot of people who (very rightly) get the ick when you say "we want to add this thing which can be used as an EoP to the OS image".

So, it's kinda hard to believe that after four years of thinking it was impossible, we actually managed to get it out the door.

Re: Sudo for Windows

#197

Earlier quoted context omitted.

Linux is just some [explitive deleted] imitation of Unix, where the sudo command originated. I run Windows as my primary development environment because it's better. Linux and other OSes run in VMs.

I don't think you should be downvoted for answering parent's question. It's helpful for understanding a mindset that not everyone possesses. Which version of Windows do you currently run, and what do you feel Windows has or does that makes it superior for your development work?

I run Windows 11. It has first-class support for Linux, with WSL, and the Windows Environment has first-class support for NVIDA graphics, popular productivity and entertainment software. It's reliable, stable, and performs well, with commercial support and scheduled major and minor updates. It's consistant. I can develop software for Windows 11 and be sure that everyone else with Windows 11 can run it.

Re: Sudo for Windows

#198
post #52

This adds a factor of enshittification for NT, NT doesn't need 88 line PowerShell scripts, this "sudo for Windows" thing makes Windows seem like a teenager's high school project. Windows NT already has runas, let NT be NT and let POSIX have sudo/doas. Previously Microsoft hired the best of the best operating systems engineers in the USA who were from Digital and they proved to be people capable of making an operating…

Thanks? But sudo * isn't a 88 line PowerShell script, it's a 1800 LOC Rust binary * isn't a NT kernel feature, it's a usermode executable * was made by (in my opinion) a perfectly decent engineer. That may be thinking too highly of myself though.

you're too kind replying to this

Re: Sudo for Windows

#199

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

I actually find that very readable. What is the problem?

The weird part of PS is the piping, which doesn't always do what you think it should as everything is an object instead of text.

Re: Sudo for Windows

#200

Earlier quoted context omitted.

Only problem is Powershell's commands are abysmally slow in comparison to chaining together Linux terminal commands that are written in C. Powershell is a super neat language though.... especially if the Microsoft team that manages it would work more with the team that does more for SMEs and not just DevOps. The overwhelming majority of windows users doing regular business work have to deal with crufty stuff like VBA…

Powershell is a terrible "language". It's fine for sysadmins to do sysadmin work but why would you want to subject business analysts to that level of unix shell inspired weirdness. Microsoft already has VB.NET which would serve that market much better. Give me C# over PS any day.

VB.net is still .NET which is fairly complicated and verbose. It's basically just a visual basic skin over C# right?
Post reply on HN