Sudo for Windows (2024)
Posted by luispa 1 day ago
Comments
Comment by petterroea 1 day ago
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-powershe...
Comment by steve1977 1 day ago
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.
Comment by vbezhenar 1 day ago
Comment by steve1977 1 day ago
Comment by vbezhenar 1 day ago
User is user. Uid is uid. It's not the same. Uid is used for file permissions, that's true.
Comment by ButlerianJihad 1 day ago
You would be unable to enforce quotas or privacy for any of them. Whatever they did on the system would be indistinguishable, because their process UIDs would be identical. Any files they created would be owned the same. Sure, set them up with unique lists of GIDs; it really doesn't matter in the end.
I have no idea what you mean "User is user", but you are right: UID is not the same as a username. The username exists only in the passwd(5) database, and not in the kernel, like at all. The kernel has no idea what usernames are, and that's why they're irrelevant to user administration.
Comment by ButlerianJihad 1 day ago
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.
Comment by man8alexd 21 hours ago
Comment by tracker1 17 hours ago
There's no such thing as "Super User" in context usage.
Comment by steve1977 16 hours ago
See here from the guy who invented it:
https://hackaday.com/2014/05/28/interview-inventing-the-unix...
and here
https://www.youtube.com/watch?v=LaAwl3HN5ds (from around 4:30 minutes... "do a superuser thing")
Also the "su" command originally stood for "superuser":
https://web.archive.org/web/20220317213155/https://www.bell-... (UNIX manual from 1971)
"su allows one to become the super—user, who has all sorts of marvelous powers"
Comment by boomlinde 1 day ago
Comment by eddythompson80 1 day ago
Comment by dainank 1 day ago
Comment by al_borland 1 day ago
Though this would be confusing, as people would pronounce it like “adieu”, which would make it sound like an alias for `logoff`.
Comment by NekkoDroid 1 day ago
"Administrator" doesn't contain a "u". `addo`/`ado` both would make more sense and flows better off the tongue.
Comment by amenhotep 18 hours ago
Comment by al_borland 1 day ago
Administrator User DO
Comment by miroljub 1 day ago
With the added benefit of having appropriate meaning in some slavic languages.
Comment by leeman2016 1 day ago
Comment by Pay08 1 day ago
Well, that explains a lot of the issues I was running into a few weeks ago...
Comment by pletnes 1 day ago
Comment by NekkoDroid 1 day ago
Comment by al_borland 1 day ago
Comment by pletnes 1 day ago
I know a few flags of curl too. These also don’t generally work with «curl».
Comment by 1718627440 16 hours ago
Comment by fainpul 1 day ago
'Remove-Alias curl, wget' >> $PROFILE
Now please stop whining about these stupid aliases.Comment by petterroea 1 day ago
Comment by fainpul 23 hours ago
Some examples from this discussion:
> The curl alias in powershell is not compatible so it is an inconvenience.
> *nix fanboys were totes fine with wget and ls being an aliases in PowerShell for years but when they found out what PS is coming to Linux they made a biggest stink.
> Only the old powershell.exe builtin to Windows has these aliases and it’s worse today because curl.exe is builtin and the curl alias takes priority when you run just curl.
> It's wget for Windows all over again
> Ah yes, the 'curl' alias in powershell, vs the 'curl.exe' binary that uses the traditional options.
Comment by tracker1 17 hours ago
Comment by pjmlp 1 day ago
Because probably this was pushed due to meet some OKRs ("made an impact").
It adds nothing over runas, other than being a known name to folks educated in UNIX.
Which is hardly of any benefit, given that Windows is not UNIX.
Comment by tjarjoura 23 hours ago
Comment by tpoacher 1 day ago
Comment by justsomehnguy 1 day ago
Between that quote and "You can't fix stupid" I always choose the one about circus.
*nix fanboys were totes fine with wget and ls being an aliases in PowerShell for years but when they found out what PS is coming to Linux they made a biggest stink. It didn't even mattered what 99.999% of the scripts which utilized that call were the simple 'get file' and nothing more.
[0] https://en.wikiquote.org/wiki/Rick_Cook#The_Wizardry_Compile...
Comment by petterroea 1 day ago
IMO .net is much better than Java, at least it was 10 years ago. So it's not like I don't understand them.
Comment by pjmlp 4 hours ago
CLR is better on the polyglot approach, although Microsoft nowadays behaves as if C means C# and not Common, and ironically JVM seems to have a more vivid guest languages ecosystem nowadays. Any of Scala, Clojure, Kotlin, Groovy, seem to enjoy more activity than F#, VB or C++/CLI.
There are plus on the JVM side that Microsoft will probably never care for.
- A single vendor implementation, Microsoft no longer cares about ECMA
- Following from being a single vendor, there aren't multiple GC, JIT and AOT approaches to chose from
- Some of those implementations explore having most of the stack bootstraped instead of still being based on C and C++.
- One of them being a compiler development framework, whereas Microsoft killed theirs (Project Phoenix)
- Others offer real time GC, and embedded deployments in high critical computing environments, although less than 20 years ago, there are still three main vendors in this area
- A mobile OS, after Microsoft botched theirs when it was around 10% market share in Europe already, and now they don't have a platform for younger generations
Note that Java, .NET and C++ are my main toolbox tools, thus it isn't hating one over the other.
Comment by tracker1 17 hours ago
For that matter, deno in a shebang for an extensionless file now detects as a TypeScript file properly in VS Code. win-win-win. While being portable with a relatively small executable surface (deon executable only).
Comment by justsomehnguy 9 hours ago
It was!
I specifically talk here about a subset of people who was very ignorant but became very angry because... well, they are probably still write it as M$ so there is no point continue.
Comment by jborean93 1 day ago
The curl and wget aliases don’t exist on the PowerShell 7 version which is the cross platform one. Only the old powershell.exe builtin to Windows has these aliases and it’s worse today because curl.exe is builtin and the curl alias takes priority when you run just curl.
Comment by justsomehnguy 18 hours ago
> Only the old powershell.exe builtin to Windows
It's "Windows PowerShell" which would be forever v5.1 and "PowerShell" is v7+.
(we don't talk about "PowerShell Core")
> builtin and the curl alias takes priority when you run just curl
Yes, but again if somebody didn't bother to read the docs, read the output (it's very evident when you have some PS error vs. everything else - and people STILL don't bother to try to understand) and start bitching on the forums... see my previous comment.
And by the way: it was established quite early what the use of an aliases in the written code should be frowned upon, exactly for the reason what the aliases aren't stable and could be local. Aliases are the quick way when you are slapping something interactively in the CLI.
So wget/curl were added for the benefit of those *nix fanboys who needed something better than cmd.exe on Windows so they could start using PS faster and later adopt to a proper ways but instead of reading the docs they only rose the stink.
Comment by petterroea 1 day ago
I still let them try, because it beats me having to check "is wsl good now", and they learn much better from personal experience than someone more senior who uses arch btw just telling them "don't use windows"
Comment by StableAlkyne 1 day ago
Only weirdness has been systemd can sometimes be quirky, and GUI stuff can be glitchy (which doesn't affect me much, because 99% of what I do is in the terminal)
So, anecdotally it is perfectly adequate for workloads beyond a Hello World. What issues are you running into?
Comment by petterroea 1 day ago
Compute etc is fine!
Comment by tracker1 17 hours ago
Permissions between Windows and Unix are always (generally) a mismatch, as is the nature of OS differences.
Comment by yread 1 day ago
Comment by pjmlp 1 day ago
Comment by pjc50 1 day ago
Dunno, looks pretty Linux to me.
(WSL1 did suck badly because it combined the limitations of NT - slow file ops and process spawn - with the limitations of a compatibility layer. WSL2 is good enough for compatibility testing work on e.g. dotnet)
Comment by tjarjoura 1 day ago
Comment by pjmlp 1 day ago
Nowadays WSL implies version 2.0, who is still using the half done implementation of WSL 1.0?
Or using Virtual Box, VMWare Workstation, QEMU,...
Comment by tracker1 17 hours ago
Comment by mastermage 1 day ago
Comment by pjmlp 1 day ago
Comment by bezier-curve 1 day ago
I use WSL2 every day and it has some annoying quirks with how their Wayland implementation behaves with DWM, but otherwise it's just a Linux environment.
Comment by sterlind 17 hours ago
1) a lightly-patched Linux kernel
2) a bunch of esoteric bridge stuff, namely:
2A) 9P for mounting the Windows filesystem on Linux and vice-versa,
2B) a Wayland server implemented via RDP(?!)
2C) Hyper-V NICs, dynamic memory and other VM integrations.
2D) even weirder esoterica like whatever magic lets CUDA work (and... directx? for reasons??)
but there's no canonical (pun intended) userspace. there are many Linux distros available; adapting a distro is usually pretty easy. for example, NixOS-WSL is lightweight and works quite well.
philosophically, WSL2 is a VM, but it's not an emulator, if that makes sense. there's a kind of convergence between OS and VM that's been going on for a decade and WSL2 has been riding that wave.
(disclaimer: I work for MS but not on Windows or WSL. I just think the arch is neat.)
Comment by DeathArrow 1 day ago
Comment by overflowy 1 day ago
Comment by tokyobreakfast 1 day ago
Comment by manwe150 1 day ago
Comment by gnabgib 1 day ago
Comment by RajT88 1 day ago
Program Name: Sudo.exe
Publisher: Unknown
File Origin: Downloaded from the Internet
Comment by pjc50 1 day ago
Comment by al_borland 1 day ago
Comment by cokecan 1 day ago
Comment by userbinator 1 day ago
Comment by steve1977 1 day ago
https://learn.microsoft.com/en-us/previous-versions/windows/...
Comment by al_borland 1 day ago
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.
Comment by userbinator 9 hours ago
There's no need to "understand" "names like grep"; you learn it as a language like any other. If you aren't thinking of "grepping" (or cd'ing, ls'ing, fsck'ing, etc.) naturally and are always trying to translate the words into English (or some other language), you're doing it wrong.
Comment by Diti 1 day ago
[1]: https://learn.microsoft.com/en-us/powershell/scripting/devel...
Comment by Diti 1 day ago
Comment by Diti 3 hours ago
Comment by chrisandchris 1 day ago
Comment by onemoresoop 1 day ago
Comment by sph 14 hours ago
Comment by garganzol 1 day ago
Comment by al_borland 1 day ago
Comment by DaSHacka 1 day ago
Comment by twelvedogs 1 day ago
Comment by G_o_D 1 day ago
With nsudo its fizz
Comment by pseudohadamard 3 hours ago
If you want a proper sudo for Windows, use gerardog's excellent gsudo, https://github.com/gerardog/gsudo. Among other things it comes with prebuilt binaries and installers.
Comment by archargelod 1 day ago
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.
Comment by LiamPowell 1 day ago
Comment by jasonjayr 1 day ago
Comment by 9dev 1 day ago
Comment by eddythompson80 1 day ago
Comment by 9dev 21 hours ago
Comment by eddythompson80 15 hours ago
Comment by 9dev 14 hours ago
Comment by paweladamczuk 1 day ago
Comment by saintfire 1 day ago
Comment by DeathArrow 1 day ago
Comment by jborean93 1 day ago
Comment by SugarReflex 1 day ago
Comment by ButlerianJihad 1 day ago
Comment by julian00 18 hours ago