7 ms·
Sudo for Windows (2024)
- gnabgib 6mo ago(2024) At the time (587 points, 423 comments) https://news.ycombinator.com/item?id=39305452 https://news.ycombinator.com/item?id=39305452
- overflowy 6mo agoWe had https://github.com/gerardog/gsudo https://github.com/gerardog/gsudo long before this came out.
- manwe150 6mo agoThat fact appears to be mentioned in the docs for this sudo, as well as mentioning gsudo has more features
- tokyobreakfast 6mo agoThe hallmark of every successful Rust project: existence of a popular, equivalent software package not written in Rust.
- SugarReflex 6mo agosudon't
- archargelod 6mo ago> Everything about permissions and the command line experience is different between Windows and Linux. ... certain elements of the traditional sudo experience are not present in Sudo for Windows, and vice versa. Scripts and documentation that are written for sudo may not be able to be used directly with Sudo for Windows without some modification. Then why is it named `sudo`? Just to create confusion? Also, something like sudo is clearly not possible on modern Windows, because Microsoft thinks it owns your computer and won't allow Admins to do certain things.
- LiamPowell 6mo agoIt's wget for Windows all over again, just like with wget there's absolutely zero arguments shared between the two that do the same thing.
- jasonjayr 6mo agoAh yes, the 'curl' alias in powershell, vs the 'curl.exe' binary that uses the traditional options. Always have to remember that trap on windows.
- paweladamczuk 6mo agoThe embracing continues
- saintfire 6mo agoNot really. It's not the same program at all. They just took the name for an inexplicable reason. They even had to make a paragraph disclaimer stating it isn't and never will be the same program.
- deleted 6mo ago[deleted]
- RajT88 6mo agoDo you want to allow the following program from an unknown publisher to make changes to this computer? Program Name: Sudo.exe Publisher: Unknown File Origin: Downloaded from the Internet
- cokecan 6mo ago"Yes"
- al_borland 6mo agosudo sudo.exe
- pjc50 6mo agoI was going to try to repro this, but it seems you can't actually download it and it's now a builtin? https://learn.microsoft.com/en-us/windows/advanced-settings/sudo/ https://learn.microsoft.com/en-us/windows/advanced-settings/...
- G_o_D 6mo agohttps://m.majorgeeks.com/files/details/nsudo.html https://m.majorgeeks.com/files/details/nsudo.html Been using it to run my cleanup or uninstaller utilities as SYSTEM/TRUSTED INSTALLER, so stubborn in use files that are not easily deletable not even with lockhunter or unlock file utilities that ultimately fallback to delete on next reboot. With nsudo its fizz
- userbinator 6mo agoI'm surprised they didn't call it Run-AsAdministrator or some other awkward Microsoft-ism.
- chrisandchris 6mo agoThat would be consistent, which is not something Microsoft is capable of.
- steve1977 6mo agoMaybe because that exists already? (and is actually more useful) https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc771525(v=ws.11) https://learn.microsoft.com/en-us/previous-versions/windows/...
- Diti 6mo agoThat would imply it is written in PowerShell. https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands https://learn.microsoft.com/en-us/powershell/scripting/devel...
- Diti 6mo agoI strangely cannot flag my own posts. Can you delete that comment (and this comment you’re currently reading), since it’s a duplicate?
- Diti 6mo agoThat would imply it is written for PowerShell specifically ([1]), and would come with several expectations (like returning PSObject objects, and other good practices). [1]: https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands https://learn.microsoft.com/en-us/powershell/scripting/devel...
- al_borland 6mo agoI spent some time years ago going through a PowerShell course by the guys who wrote it. They explained their thought process and it actually made a lot of sense. Descriptive verb-noun naming to makes scripts readable, with aliases to make things quick and easy in the shell. It’s easier to understand than names like grep, which require the user know ed and decades old history to figure out that it means global regular expression print. Without any *nix history, Select-String with an alias of sls, can make more intuitive sense and be easier to remember. The alias is also faster to type.
- petterroea 6mo agosudo makes sense as a name, but it is worth noting that it hurts the original projects. Famously, the curl project receives tonnes of issues and support requests from people who run `curl` in PowerShell, not knowing it is an alias meant for convenience instead of the actual curl command[1]. Sudo for windows is already relatively old and doesn't seem to have been adopted much, but my prediction is that adoption would mean people would complain on forums that commands they found on the internet don't work. "Why wouldnt it? I have sudo?". Then people will have to explain to them that "No you do not have sudo, you have the windows version of sudo, which is not real sudo" and it will confuse. When it comes to tools, I strongly believe naming things similarly to concepts the user already knows is a disservice to the user. This isn't UX for your mom and pop, it is a tool to perform a job, and learners get confused when suddenly the same thing isn't actually the same thing at all. It is mislearning, and I would argue almost anyone who does mentoring has seen this in action. [1]: https://daniel.haxx.se/blog/2016/08/19/removing-the-powershell-curl-alias/ https://daniel.haxx.se/blog/2016/08/19/removing-the-powershe...
- steve1977 6mo ago> sudo makes sense as a name It doesn't though. There is no concept of a singular superuser like there is on UNIX. On Windows you have Administrator, but that is a role that can be assigned to any user. And Administrators do not have full power, that would be the SYSTEM user. Which you cannot switch to with Sudo for Windows however - but you can with the runas tool, which has been around for decades.
- vbezhenar 6mo agoMinor nitpick, but there's not necessarily a single super user in UNIX. You can create multiple users with uid=0 and they all will be super users.
- ButlerianJihad 6mo agoBut they all have the same UID, and are technically "the same user", even if you foolishly confer disparate usernames and passwords on them. When the system reverse-maps their UID it will display "root" because there is, ultimately, only one superuser on Unix. The situation is the same for any userid and any groupid. If you try creating three ordinary users with a UID of 3005, they will be, essentially, the same user. There is no way at the system level to differentiate them, after they have authenticated. Because their files and processes are owned by the same UID. This sharing of UIDs is generally discouraged and quite undesirable. It makes systems administration a real mess.
- onemoresoop 6mo agoLipstick on a pig, Windows is turning into a botched version of linux.
- garganzol 6mo agoWindows always has been a Unix alter-ego since DOS 2.x which had started to accept '/' characters as directory separators, or maybe even before that.
- al_borland 6mo agoI keep waiting for Microsoft to give up on maintaining their own kernel and moving to Linux. Kind of like what they did with the browser engine, and building atop Chrome.
- DaSHacka 6mo agoWhy would they ever do that though? Breaking backwards compatibility and losing all their work on the NT kernel for no gain?
- sph 6mo agoI'm still betting on Microsoft buying Canonical one day and releasing their own distro.
- 9dev 6mo agoFunny that this pops up when Linux at the same time is moving on to something better than sudo.
- eddythompson80 6mo agoAre you referring to sudo-rs or something different? because sudo-rs is just a reimplementation of sudo.
- 9dev 6mo agoNo; I'm referring to run0. See, for example: https://edu4rdshl.dev/posts/new-year-new-sudo-using-systemd-s-run0-as-a-sudo-replacement https://edu4rdshl.dev/posts/new-year-new-sudo-using-systemd-...
- eddythompson80 6mo agoOh okay. That’s very specific to using setUID vs an alternative. Both have no real equivalent on windows to begin with.
- 9dev 6mo agoYeah, I’m aware of that. But this windows-sudo is sudo in name only anyway, so it seemed funny they’d copy a term that’s just about to go out of fashion.
- deleted 6mo ago[deleted]
- deleted 6mo ago[deleted]
- DeathArrow 6mo agoWhat's wrong with good old runas command?
- jborean93 6mo agoThe runas command doesn’t elevate just runs as another user. This is a console executable that drives UAC and also provides a way to capture the stdout/stderr elevated process which isn’t natively possible today without your own wrapper.
- deleted 6mo ago[deleted]
- twelvedogs 6mo agoUnless this is improved greatly from the last time I used it is pointless, any command you would use it for instead requires you to right click, open as administrator a command prompt to get the expected result
- ButlerianJihad 6mo agoSandwich https://xkcd.com/149/ https://xkcd.com/149/
- deleted 6mo ago[deleted]
- julian00 6mo ago[dead]
- pseudohadamard 6mo agoIt's not sudo for Windows, it's a pile of rust which, if you figure out how to assemble it, presumably turns into some Microsoft interpretation of sudo which, judging by all the open issues, might be an attempt at grep that went wrong somewhere. If you want a proper sudo for Windows, use gerardog's excellent gsudo, https://github.com/gerardog/gsudo https://github.com/gerardog/gsudo. Among other things it comes with prebuilt binaries and installers.