TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Sudo for Windows

587 点作者 zadjii超过 1 年前

62 条评论

zadjii超过 1 年前
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 未加载
matthews2超过 1 年前
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 未加载
dundarious超过 1 年前
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 未加载
jimt1234超过 1 年前
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 未加载
PreInternet01超过 1 年前
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 未加载
israrkhan超过 1 年前
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 未加载
FergusArgyll超过 1 年前
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 未加载
SushiHippie超过 1 年前
<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 未加载
jaylittle超过 1 年前
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 未加载
gpvos超过 1 年前
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>
codeflo超过 1 年前
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 未加载
msravi超过 1 年前
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 未加载
bogota超过 1 年前
Windows tries to improve the developer experience… why not call it wudo or something funny since devex on windows is obviously a joke.
评论 #39312868 未加载
vergessenmir超过 1 年前
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
shortformblog超过 1 年前
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 未加载
jhickok超过 1 年前
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-01超过 1 年前
Can&#x27;t wait for new malware to sudo-up the calculator &amp;&amp; bitsadmin.
alyandon超过 1 年前
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?
swamplander超过 1 年前
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 未加载
dm319超过 1 年前
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 未加载
HackerLemon超过 1 年前
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 未加载
slenk超过 1 年前
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.
pjmlp超过 1 年前
We already have runas for years now.<p>This looks like one of those KPI fulfilling projects.
评论 #39306982 未加载
评论 #39307844 未加载
评论 #39306525 未加载
评论 #39313772 未加载
评论 #39306954 未加载
ilovecurl超过 1 年前
&quot;Those who do not understand Unix are condemned to reinvent it, poorly.&quot; -Henry Spencer
lostruinsofraku超过 1 年前
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 未加载
MarkSweep超过 1 年前
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 未加载
niux超过 1 年前
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>
JohnMakin超过 1 年前
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 未加载
charcircuit超过 1 年前
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.
forgotpwd16超过 1 年前
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.
zcbenz超过 1 年前
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>)
orev超过 1 年前
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’)
SteveNuts超过 1 年前
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-clean超过 1 年前
Why is Inline not the default option?
评论 #39311069 未加载
BiteCode_dev超过 1 年前
Good news.<p>But I&#x27;m also bracing for millions of windows users that will now be able to sudo pip install.
Night_Thastus超过 1 年前
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_antonyan超过 1 年前
One day they&#x27;ll replace the kernel with Linux and nobody notices
评论 #39312602 未加载
osigurdson超过 1 年前
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 未加载
whoitwas超过 1 年前
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 未加载
tonymet超过 1 年前
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 未加载
oflebbe超过 1 年前
Next: systemd for windows?
评论 #39306420 未加载
评论 #39309980 未加载
shmeeed超过 1 年前
Is it April 1st already?
ronniefalcon超过 1 年前
what about &quot;runas&quot; :-) or this is considered psuedo-sudo?
teekert超过 1 年前
… Checking the date… Nope it’s probably real (and makes sense!)
lupire超过 1 年前
Should be ado (admin do), since superuser is a Linux thing
PeterStuer超过 1 年前
Can someone detail the differences between this and runas plz?
评论 #39308439 未加载
scrlkrunner超过 1 年前
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___超过 1 年前
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_aargh超过 1 年前
alternative name suggestions:<p><pre><code> * asadmin * admindo * adminrun * admrun * elevate * privelev</code></pre>
yrro超过 1 年前
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...
jojobas超过 1 年前
After long 40+ years Windows has caught up.
broknbottle超过 1 年前
missed opportunity to call it suwoop
RadixDLT超过 1 年前
hmmm, so I no longer need to right click on cmd and run as administrator?
ChoGGi超过 1 年前
Eh, nothing wrong with psexec.exe -i -s<p>Guess it&#x27;s good to have more options though.
评论 #39315590 未加载
riffic超过 1 年前
reinventing Unix, poorly.
joshxyz超过 1 年前
sudo make me a sandwich!
spogbiper超过 1 年前
sudo cmd.exe<p>the new &quot;sudo bash&quot;
selimnairb超过 1 年前
sudo deltree c:\
评论 #39309572 未加载
jeffrallen超过 1 年前
I just hope Windows sudo is not as braindead as PowerShell&#x27;s wget!
r366y6超过 1 年前
Get over it, Microsoft and migrate to a Unix kernel ;)
jksmith超过 1 年前
If you&#x27;d like to use sudo, it&#x27;s available in Linux.
johnea超过 1 年前
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 未加载