Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

391–400 of 439 posts

Re: Sudo for Windows

#391

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.

> 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

Or by using a bash builtin that duplicates a normal command.

Re: Sudo for Windows

#392
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)?

Also the preference should actually describe it better > Enable Sudo > Enables the sudo command If I were a scammer I could make up an acronym or something that sudo means and trick someone into turning this on because the toggle doesn't actually describe what it is so I can just weave my own narrative.

I think you're overthinking this. At the point that the scammer is getting the victim to change settings, overcoming UAC is not the problem.

Re: Sudo for Windows

#393

Earlier quoted context omitted.

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.

ASCII Clippy appears: "It looks like you're trying to do privilege escalation"

Isn't that followed by "Would you like me to help you with that?"

Re: Sudo for Windows

#394
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 guess id say thanks for all your hard work, but i dont use windows.

exactly how is 'sudo for windows' different than the existing model in windows 10 where privilege elevation is a popup window and you click through it? arguably the current model is just sudo with nopasswd.

how do you reconcile the idea that your effort --without principled reform of the windows security model at a fundamental level-- is just cargo-culting a more successful projects security model?

'Start-Process powershell -Verb runAs' is the same or different than this?

Thanks for caring about security and trying to make things better. its hard, thankless and frustrating (and thats just the windows part ;))

Re: Sudo for Windows

#395

I already use https://github.com/lukesampson/psutils which has a sudo.ps1, which I install via scoop (I know that's a mouthful, but I just install scoop and run `scoop install sudo`). I used it from powershell literally just before I opened this article (after copy-pasting a password, I copy some random text laying around in the browser, like "com", then run `sudo restart-service -name 'cbdhsvc*'` to clear the clipbo…

Mind that Windows has clipboard (win+v) history and you may've that enabled

Re: Sudo for Windows

#396

Earlier quoted context omitted.

The onus isn't on me to disprove that 99% of cat users don't care about concatenation, but here's a non-comprehensive list of projects using cat to concatenate files: OpenSSL, Curl, Git, Linux, Gettext, NodeJS, zstd, GCC, FFmpeg, OpenJDK, Pyenv I think users, upstream developers, and downstream packagers of these software will all be upset if cat ceased to concatenate. Example: https://sourcegraph.com/search?q=contex…

Half of those examples from git don't even invoke cat, another quarter don't concatenate files, and the final quarter use it for preparing test data. Well, I guess the last is a valid use although again, most of those uses could've used printf "$chunk_of_data" >>output instead of writing temporary files all over the temp directory, and I imagine the "git am" test could've been written as "git am patch1 patch2" instea…

> Half of those examples from git don't even invoke cat

That's because it's a regex search and not relevant to the point at all. What matters is that people use widely advertised features of a popular tool, including sudo and cat. Especially if that feature is the single stated purpose of the tool.

Taking a name of a widely used tool and slapping it on something that doesn't even do what the original was made for isn't a nice thing to do. I don't get why that's controversial to anyone.

> so cat should do one thing

That one thing is con-"cat"-enating files, so to speak. Why should it become something different just to make the name Sudo for Windows appear somehow less misleading?

Also,

    rm out.txt
    for f in *.log; do cat "$f" >> out.txt; done
is a clunky way of concatenating files.

    { for f in *.log; do cat "$f"; done; } | less

Even clunkier.

Re: Sudo for Windows

#397
post #136

Earlier quoted context omitted.

Is this a serious question?

Did I stutter?

Apparently, because you can't seriously be asking that question. You've clearly never worked in any kind of customer support position, because businesses and individuals need all kinds of help with a transition like that.

Re: Sudo for Windows

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

As a self-identified linux engineer who, despite tremendous efforts to avoid it, has somehow managed to still spend about half my career having to care about windows in some way... the answer to "how do you do [thing] on windows sanely?" is generally "it is simply done insanely instead."

Am I biased? Haha yes, I have a signed copy of Free Software, Free Society. But also I have spent years caring about products that do need to work on windows. And my professional take is "there is always a way to do it, but it is very seldom pretty." (And my take for linux is "there is always a way to do it, often more than one, and at least one of them is going to be pretty, but which one is the pretty one will depend greatly on who you are and what you're doing").

Re: Sudo for Windows

#399

So Microsoft implicitly admits DOS sucks and creates a PowerShell prompt. Then Microsoft doubles down and introduces a better prompt called WSL - the Windows Subsystem for Linux because the Windows command prompt still sucks... and this is just a Ubuntu VM in Windows. And now they implement Sudo? Microsoft hasn't learned the first lesson of holes - when you find yourself in one, stop digging.

This doesn't make any sense. PowerShell and WSL serve entirely different purposes. PowerShell is bash-but-better for Windows. WSL is a developer-oriented way of running Linux/Unix software on Windows.

Re: Sudo for Windows

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

scoop install sudo.

Sorry, this has been lacking for so long that you know... Late to the party.

Post reply on HN