TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sudo for Windows

587 pointsby zadjiiover 1 year ago

62 comments

zadjiiover 1 year ago
Yep, it&#x27;s really happening. Sudo is coming to Windows. It&#x27;s obviously not just a fork of the linux sudo - there&#x27;s enough that&#x27;s different about the permissions structure between OS&#x27;s that just a straight port wouldn&#x27;t make sense. But the dream of being able to run commands as admin, in the same terminal window - that&#x27;s the experience we&#x27;re finally bringing to users.<p>I&#x27;ve been working on this for the last few months now and I&#x27;m pretty excited to talk about it or answer any questions!
评论 #39312058 未加载
评论 #39306406 未加载
评论 #39307659 未加载
评论 #39309939 未加载
评论 #39319206 未加载
评论 #39305960 未加载
评论 #39306663 未加载
评论 #39309051 未加载
评论 #39305866 未加载
评论 #39311872 未加载
评论 #39310173 未加载
评论 #39313432 未加载
评论 #39310422 未加载
评论 #39316678 未加载
评论 #39313544 未加载
评论 #39318478 未加载
评论 #39312588 未加载
评论 #39306207 未加载
评论 #39313869 未加载
评论 #39313873 未加载
评论 #39310740 未加载
评论 #39309247 未加载
评论 #39312929 未加载
评论 #39318254 未加载
评论 #39311589 未加载
评论 #39306769 未加载
matthews2over 1 year ago
This smells like when PowerShell aliased curl and wget to a completely different command, with incompatible arguments.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;PowerShell&#x2F;PowerShell&#x2F;pull&#x2F;1901">https:&#x2F;&#x2F;github.com&#x2F;PowerShell&#x2F;PowerShell&#x2F;pull&#x2F;1901</a>
评论 #39312761 未加载
评论 #39313275 未加载
评论 #39315529 未加载
评论 #39314515 未加载
dundariousover 1 year ago
I already use <a href="https:&#x2F;&#x2F;github.com&#x2F;lukesampson&#x2F;psutils">https:&#x2F;&#x2F;github.com&#x2F;lukesampson&#x2F;psutils</a> which has a sudo.ps1, which I install via scoop (I know that&#x27;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 &quot;com&quot;, then run `sudo restart-service -name &#x27;cbdhsvc*&#x27;` to clear the clipboard history -- does not clear the current value). There is a UAC prompt, but it&#x27;s perfectly adequate for interactive work.
评论 #39309101 未加载
评论 #39316727 未加载
评论 #39314812 未加载
jimt1234over 1 year ago
Side note that I&#x27;ve always found interesting: <i>sudo</i> is almost entirely maintained by one dude: <a href="https:&#x2F;&#x2F;github.com&#x2F;sudo-project&#x2F;sudo&#x2F;graphs&#x2F;contributors">https:&#x2F;&#x2F;github.com&#x2F;sudo-project&#x2F;sudo&#x2F;graphs&#x2F;contributors</a>
评论 #39311431 未加载
评论 #39310879 未加载
评论 #39313392 未加载
评论 #39312206 未加载
PreInternet01over 1 year ago
Well, sudo for Windows has been a thing for, like, a few years now?... <a href="https:&#x2F;&#x2F;github.com&#x2F;gerardog&#x2F;gsudo">https:&#x2F;&#x2F;github.com&#x2F;gerardog&#x2F;gsudo</a><p>Not sure if this is the same thing, but this definitely should have shipped with the very first implementation of &quot;oh, sure, you&#x27;re an Administrator, but not really, since we&#x27;re ignoring that bit&quot; a.k.a. User Account Control.<p>That would have saved about a metric ton of misguided &quot;here&#x27;s how to turn off UAC&quot; tutorials, but, ehm, yeah, anything to inject some life into the moribund Windows Insiders Program (the one where <a href="https:&#x2F;&#x2F;blogs.windows.com&#x2F;windows-insider&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blogs.windows.com&#x2F;windows-insider&#x2F;</a> proudly headlines &quot;What’s coming for the Windows Insider Program in 2023&quot;), right?
评论 #39306313 未加载
评论 #39310441 未加载
israrkhanover 1 year ago
When I was at Microsoft we did not use to consider UAC as a security boundary, since there were ways to bypass it. (I used to work on windows kernel security). I wonder how security team let this feature get shipped. Or perhaps now they consider UAC as a security boundary.
评论 #39310722 未加载
评论 #39310698 未加载
评论 #39309990 未加载
FergusArgyllover 1 year ago
Considering the way PowerShell commands go, I assume this will be:<p><pre><code> RunWithAllTheElevatedPermissionsPossible --YesEvenThose .\inthisfolder.folder\. grep : The term &#x27;grep&#x27; is not recognized....</code></pre>
评论 #39311824 未加载
评论 #39313199 未加载
SushiHippieover 1 year ago
<a href="https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;sudo&#x2F;issues&#x2F;11">https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;sudo&#x2F;issues&#x2F;11</a><p>Interesting<p>&gt; Reserved<p>&gt; not blank!<p>&gt; We like to camp nice round number issues like this one, for future use.<p>Can you reuse GitHub issue numbers, or what could be their intention here?
评论 #39306047 未加载
评论 #39306212 未加载
评论 #39306755 未加载
jaylittleover 1 year ago
I guess this is a thing on Windows now. However at the moment, it seems to be a very insecure thing. But hey it&#x27;s early days... I predict they&#x27;ll eventually get it right 125 patch Tuesdays from now.<p><a href="https:&#x2F;&#x2F;fosstodon.org&#x2F;@serghei@mastodon.social&#x2F;111900986825278831" rel="nofollow">https:&#x2F;&#x2F;fosstodon.org&#x2F;@serghei@mastodon.social&#x2F;1119009868252...</a>
评论 #39318415 未加载
评论 #39315239 未加载
gpvosover 1 year ago
Good. Although &quot;elevate&quot; from Nirsoft[0] generally worked well for me, it&#x27;s nice to have something more integrated into the system.<p>[0] <a href="http:&#x2F;&#x2F;nircmd.nirsoft.net&#x2F;elevate.html" rel="nofollow">http:&#x2F;&#x2F;nircmd.nirsoft.net&#x2F;elevate.html</a>
codefloover 1 year ago
Sad that it&#x27;s Windows 11 only. I can&#x27;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&#x27;s nothing I can do. It&#x27;s the first time a software vendor actively doesn&#x27;t want me to to have their latest software, but it is what it is.
评论 #39310977 未加载
评论 #39309596 未加载
评论 #39315614 未加载
msraviover 1 year ago
Here&#x27;s hoping that &quot;Windows 12&quot; will be just a Window manager + Desktop running on Linux, with all existing bugs meticulously replicated to maintain backwards compatibility with Windows 95&#x2F;7&#x2F;8&#x2F;10&#x2F;11.
评论 #39313265 未加载
评论 #39312898 未加载
评论 #39313113 未加载
评论 #39315666 未加载
bogotaover 1 year ago
Windows tries to improve the developer experience… why not call it wudo or something funny since devex on windows is obviously a joke.
评论 #39312868 未加载
vergessenmirover 1 year ago
How do you wax lyrical for an entire article about the excellently engaging ergonomics of sudo and not mention Linux&#x2F;Unix family of OSes
shortformblogover 1 year ago
Just pointing out that this is a really good tweet by the co-creator of sudo: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;BobCoggeshall&#x2F;status&#x2F;1755681410596192604" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;BobCoggeshall&#x2F;status&#x2F;1755681410596192604</a>
评论 #39314531 未加载
评论 #39309230 未加载
jhickokover 1 year ago
If it&#x27;s just an alias for &quot;runas&quot; that presents a UAC prompt window I will be disappointed.
评论 #39309766 未加载
评论 #39307693 未加载
评论 #39307377 未加载
1970-01-01over 1 year ago
Can&#x27;t wait for new malware to sudo-up the calculator &amp;&amp; bitsadmin.
alyandonover 1 year ago
Is this going to be a fully proper implementation with a sudoers config such that something like<p><pre><code> sudo c:\some\path\to\normally_needs_elevation_to_function.exe </code></pre> will work for my user in my current desktop session without an elevation prompt?
swamplanderover 1 year ago
So Microsoft implicitly admits DOS sucks and creates a PowerShell prompt.<p>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.<p>And now they implement Sudo?<p>Microsoft hasn&#x27;t learned the first lesson of holes - when you find yourself in one, stop digging.
评论 #39318140 未加载
评论 #39315510 未加载
评论 #39314906 未加载
评论 #39315987 未加载
dm319over 1 year ago
Ironic, didn&#x27;t we find out they had patented sudo a decade ago?<p><a href="https:&#x2F;&#x2F;arstechnica.com&#x2F;information-technology&#x2F;2009&#x2F;11&#x2F;microsofts-psuedo-sudo-patent-doesnt-really-cover-sudo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;arstechnica.com&#x2F;information-technology&#x2F;2009&#x2F;11&#x2F;micro...</a>
评论 #39309420 未加载
HackerLemonover 1 year ago
What&#x27;s the difference from opening a Terminal (Admin) window? Just that you can run a single command as admin? I must be missing something here
评论 #39306579 未加载
评论 #39306616 未加载
评论 #39307168 未加载
slenkover 1 year ago
Scoop provides <a href="https:&#x2F;&#x2F;github.com&#x2F;lukesampson&#x2F;psutils">https:&#x2F;&#x2F;github.com&#x2F;lukesampson&#x2F;psutils</a>, which works really well, I am sure there are a million things people will tell me I am missing.
pjmlpover 1 year ago
We already have runas for years now.<p>This looks like one of those KPI fulfilling projects.
评论 #39306982 未加载
评论 #39307844 未加载
评论 #39306525 未加载
评论 #39313772 未加载
评论 #39306954 未加载
ilovecurlover 1 year ago
&quot;Those who do not understand Unix are condemned to reinvent it, poorly.&quot; -Henry Spencer
lostruinsofrakuover 1 year ago
Can you draw the part of the diagram in the blog post based off of these sentences? <a href="https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;commandline&#x2F;introducing-sudo-for-windows&#x2F;#input-closed-and-inline" rel="nofollow">https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;commandline&#x2F;introducing-sudo-...</a><p>In these configurations, sudo.exe will launch a new elevated process, an elevated sudo.exe process, and the original unelevated sudo.exe will establish an RPC connection with the new elevated process. In other words, information is passed from the unelevated sudo instance to the elevated one.
评论 #39307033 未加载
MarkSweepover 1 year ago
Do caffeinate next!<p>That reminds me, I have a half-written implementation here:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;AustinWise&#x2F;caffeinate">https:&#x2F;&#x2F;github.com&#x2F;AustinWise&#x2F;caffeinate</a>
评论 #39310775 未加载
niuxover 1 year ago
There&#x27;s already a tool out there that works just fine: <a href="https:&#x2F;&#x2F;github.com&#x2F;gerardog&#x2F;gsudo">https:&#x2F;&#x2F;github.com&#x2F;gerardog&#x2F;gsudo</a>
JohnMakinover 1 year ago
If it were anyone but windows this sentence wouldn&#x27;t alarm me like it does:<p>&gt; Sudo for Windows is a new way for users to run elevated commands directly from an unelevated console session
评论 #39305937 未加载
charcircuitover 1 year ago
While this looks more secure than the original, I don&#x27;t think modern operating systems should be investing resources into making privilege escalation easier for users to do. Considering UAC already exists it&#x27;s not like the additon of sudo is much worse to include so overall it may be better, but I feel investing resources to get rid of the need of users needing to elevate things would be time better spent.
forgotpwd16over 1 year ago
If anyone on older Windows version, `elevate` tool is similar. Also if it isn&#x27;t the normal sudo command maybe call it something else as well.
zcbenzover 1 year ago
I wrote a Node.js module that implemented similar feature years ago. <a href="https:&#x2F;&#x2F;github.com&#x2F;atom-archive&#x2F;node-runas">https:&#x2F;&#x2F;github.com&#x2F;atom-archive&#x2F;node-runas</a> (An updated fork can be found at <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;runas-redux" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;runas-redux</a>)
orevover 1 year ago
One of the most important aspects of ‘sudo’ is that it takes the password of the user who started it, not the admin password. Will this ‘sudo’ work like that, or does it need the user to know an administrator password? If it needs an admin password, it shouldn’t be called ‘sudo’ (it would be an analog of ‘su’)
SteveNutsover 1 year ago
This will be a very controversial prediction, but mark my words: Windows will eventually use the Linux kernel.
评论 #39306555 未加载
评论 #39307520 未加载
评论 #39306971 未加载
评论 #39306211 未加载
评论 #39306280 未加载
评论 #39309763 未加载
评论 #39313938 未加载
squeaky-cleanover 1 year ago
Why is Inline not the default option?
评论 #39311069 未加载
BiteCode_devover 1 year ago
Good news.<p>But I&#x27;m also bracing for millions of windows users that will now be able to sudo pip install.
Night_Thastusover 1 year ago
Interesting. I&#x27;ve been pretty happy with all the Unix-related updates they&#x27;ve put out lately. WSL has been a godsend and the new terminal and powershell have worked a treat. Glad they seem to be continuing with it.
评论 #39306736 未加载
oleg_antonyanover 1 year ago
One day they&#x27;ll replace the kernel with Linux and nobody notices
评论 #39312602 未加载
osigurdsonover 1 year ago
Windows should just run Linux. For apps that really need the Windows OS, use something akin to macOS parallels. I really like WSL of course, but would prefer an inverted paradigm.
评论 #39314807 未加载
whoitwasover 1 year ago
I&#x27;ve tried several times to code on Windows. It&#x27;s nearly impossible for a person used to Unix based systems. Seems it&#x27;s getting slightly better. Nice.
评论 #39313201 未加载
tonymetover 1 year ago
sudo on windows has a different risk profile given the malware ecosystem and lack of educated&#x2F; trained users.<p>95% of linux users are developers who understand risk -- though are prone to mistakes<p>99% of windows users are casual consumers .<p>Let&#x27;s keep this functionality narrowly accessible : restricted to developer mode and very formal consent. I suggest disabling it if it&#x27;s unused for a few days<p>this will only rejuvenate the malware market.
评论 #39307435 未加载
oflebbeover 1 year ago
Next: systemd for windows?
评论 #39306420 未加载
评论 #39309980 未加载
shmeeedover 1 year ago
Is it April 1st already?
ronniefalconover 1 year ago
what about &quot;runas&quot; :-) or this is considered psuedo-sudo?
teekertover 1 year ago
… Checking the date… Nope it’s probably real (and makes sense!)
lupireover 1 year ago
Should be ado (admin do), since superuser is a Linux thing
PeterStuerover 1 year ago
Can someone detail the differences between this and runas plz?
评论 #39308439 未加载
scrlkrunnerover 1 year ago
This adds a factor of enshittification for NT, NT doesn&#x27;t need 88 line PowerShell scripts, this &quot;sudo for Windows&quot; thing makes Windows seem like a teenager&#x27;s high school project. Windows NT already has runas, let NT be NT and let POSIX have sudo&#x2F;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 system able to scale from MIPS to PowerPC&#x2F;DEC Alpha&#x2F;IA-32&#x2F;amd64&#x2F;Itanium with any combination of hardware and peripherics, now they&#x27;re allowing random people to push 88 line scripts and calling it a day. Very few people in this world deserve the privilege of touching any Windows NT code and even more few people deserve the possibility of pushing things to the build lab of Windows NT 10&#x2F;11 builds
评论 #39306809 未加载
评论 #39307333 未加载
COMMENT___over 1 year ago
The new command is named “sudo” because customer feedback and because MUSCLE MEMORY:<p>I hear you! We thought about some of the options you’re calling out here. <i>A lot of customers voiced having the muscle memory of doing similar flows on various operating systems was more important to them and that’s where we landed</i>. I totally understand your perspective and I do really appreciate the feedback. I’m always trying to learn from people like you so I can help to build things that will make your life better.<p>From <a href="https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;commandline&#x2F;introducing-sudo-for-windows&#x2F;#comment-6032" rel="nofollow">https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;commandline&#x2F;introducing-sudo-...</a>
aargh_aarghover 1 year ago
alternative name suggestions:<p><pre><code> * asadmin * admindo * adminrun * admrun * elevate * privelev</code></pre>
yrroover 1 year ago
This is good, but runas already exists. Its interface is shit. Improve it to make it not shit please. Don&#x27;t hijack the name of an existing command unless you&#x27;re going to re-implement its interface 100% compatibly.<p>This is like when PowerShell hijacked curl all over again...
jojobasover 1 year ago
After long 40+ years Windows has caught up.
broknbottleover 1 year ago
missed opportunity to call it suwoop
RadixDLTover 1 year ago
hmmm, so I no longer need to right click on cmd and run as administrator?
ChoGGiover 1 year ago
Eh, nothing wrong with psexec.exe -i -s<p>Guess it&#x27;s good to have more options though.
评论 #39315590 未加载
rifficover 1 year ago
reinventing Unix, poorly.
joshxyzover 1 year ago
sudo make me a sandwich!
spogbiperover 1 year ago
sudo cmd.exe<p>the new &quot;sudo bash&quot;
selimnairbover 1 year ago
sudo deltree c:\
评论 #39309572 未加载
jeffrallenover 1 year ago
I just hope Windows sudo is not as braindead as PowerShell&#x27;s wget!
r366y6over 1 year ago
Get over it, Microsoft and migrate to a Unix kernel ;)
jksmithover 1 year ago
If you&#x27;d like to use sudo, it&#x27;s available in Linux.
johneaover 1 year ago
If everyone thinks this is so great (just judging by the number of times it&#x27;s appeared in the HN top 30), why don&#x27;t they just run linux, instead of some sh!t immitation?<p>Everyone knows, if you can C colon, your running a M$ product...
评论 #39307952 未加载