Live data from Hacker News

Sudo for Windows

devblogs.microsoft.com

381–390 of 439 posts

Re: Sudo for Windows

#381

Earlier quoted context omitted.

winget has Python 3.12.2 at the moment, which has been released two days ago. And you don't have to use --id - you can do `winget install 7zip` etc in cases where there's no ambiguity.

It doesn't turn up here, maybe I'm on the wrong website? https://winget.run/search?query=python%203.12 . For that matter 7zip doesn't show up in that search either. I was able to find the 7zip page by googling for it: https://winget.run/pkg/7zip/7zip But as with Python the default suggestion is `winget install -e --id 7zip.7zip`. If I can just do `winget install 7zip`, why can't they show that command? Why is the com…

> But as with Python the default suggestion is `winget install -e --id 7zip.7zip`. If I can just do `winget install 7zip`, why can't they show that command? Why is the complicated way the default and the simple, intuitive method optional and not easily discoverable?

Those sites give you the command line exact match (-e) --id as a safety precaution so that you install exactly what you were looking at on that website and not a fake or similarly named but different installer or a different version than what you expected.

The complicated way is optional, you are using two different options: -e and --id. The CLI's default is actually sloppier when you don't use those two options in that way.

It seems easily discoverable from `winget --help` to me. But I tend to use `winget search` rather than websites, so maybe I'm just more familiar with it.

Re: Sudo for Windows

#382
post #373

Eh, nothing wrong with psexec.exe -i -s Guess it's good to have more options though.

psexec -i -s is more than sudo, it runs as SYSTEM. Basically with kernel level permissions, that is above admin.

Still, doesn’t prevent antimalware software from blocking you if you try something naughty.

Re: Sudo for Windows

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

Isn't running commands as admin, in the same terminal window, already possible via the use of runas.exe? Granted I haven't daily driven Windows in years but IIRC that does the job albeit with clunkier syntax.

runas doesn't support "same terminal window", it always has launched a new window.

It's possible this sudo could have been implement as yet more clunky flags to runas, but it seems like making it a separate tool has benefits: off by default, whereas runas is a nearly always-on required built-in; more importantly a nicer less clunky syntax.

Re: Sudo for Windows

#384

Sad that it's Windows 11 only. I can't upgrade. I have a normal, recent PC that I dual boot with Linux, and Microsoft wants me to keep Windows 10 in that constellation. Upgrading is prevented by a silly if statement, and there's nothing I can do. It's the first time a software vendor actively doesn't want me to to have their latest software, but it is what it is.

There's always gsudo: https://github.com/gerardog/gsudo

Re: Sudo for Windows

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

If that ever happens, it'll bring Microsoft dependencies to the Linux ecosystem. In not sure that's a good thing anymore with the endless enshittification going on in Windows. Just imagine the poor distro maintainers constantly battling to disable spyware, ads, nag screens, and unwanted configuration changes caused by Microsoft packages. I feel sorry for them just by thinking about it.

Re: Sudo for Windows

#386
post #275

Earlier quoted context omitted.

Windows change is welcoming, yet still not quality. As stated by someone below, sudo is https://www.sudo.ws/ . Microsoft should give it a proper distinctive name lie wsudo or psudo. Little thinks like is compounds the issues with Windows / Microsoft. Even continually sticking to old design patterns causes issues in development and deployment. Big name companies do not trust applications running on hosted Windows beca…

Is that really what companies have to do to "trust Windows"? From my experience, it's rather driven from the need to look compliant. Thus, managers without in-depth knowledge decide to buy "endpoint security solutions", the more the merrier, deploy them to your machine, and that brings things down to a crawl. Why to a crawl? Well, I've witnessed multiple antivirus products go bezerk on your dev folder if you compile…

Most businesses that use Windows and/or Microsoft products do no go through all of that. The main benefit of using Microsoft is all of the integration between development products and DevOps. Most of the solutions for security are not provided by Microsoft, and often are looking to check off boxes to make auditors feel better, without actually enhancing anything. I've had to create some bizarre workarounds just to get past auditors, and in the end the solution was no more secure than doing nothing at all.

Re: Sudo for Windows

#387

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

As a regular Windows, Linux (via WSL), and macOS user, I'm not confused by the curl/wget alias in Powershell, and I appreciate it. I understand from context that it's not actually curl and has different options. It's much easier than remembering whatever Invoke-HyperText-Transfer-Protocol-Request -Url incantation that's native to Powershell.

[deleted]

Re: Sudo for Windows

#388
post #22

Earlier quoted context omitted.

We've actually done that for a few years on the Terminal repo. It's great for things like megathreads / scenarios / epics. For example, I can tell you off the top of my head that microsoft/terminal#8888 is for "quake mode", and #4000 is the extensions thread. We even used to have a bot that would auto-camp anything that was a multiple of 1000 or 1111 :D

That's a rather fun hack for issue numbers. Of course, a more robust strategy would be to have a specialised short-link generator for special issues!

As they work at Microsoft, they all have aka.ms and can generate any short link they like.

But it won't work if another user talks about issue 1234, and you only have the short links in your head.

Re: Sudo for Windows

#389

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.

I wish they committed to implementing more of the POSIX standard instead. They only ever implemented an initial version, and then added tiny parts of it in incompatible ways.

Re: Sudo for Windows

#390

Earlier quoted context omitted.

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.

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