How Windows Is Bringing Linux‑Style sudo to Its Command Line
Windows 11 Insider builds are adding a native sudo command that lets users elevate individual commands with familiar Linux‑style privilege management, offering finer‑grained control than the traditional "Run as administrator" option while reflecting Microsoft's growing embrace of Linux technologies.
Native sudo in Windows 11
Microsoft announced a native sudo command for Windows, first shipped in the Windows 11 Insider preview (build 26052). The command runs in Windows Terminal and triggers the standard User Account Control (UAC) dialog to obtain administrator rights for a single command.
How to enable
Join the Windows Insider program.
Open Settings → Developer options and toggle the “sudo” feature, or run an elevated PowerShell/Command Prompt and execute the activation command (e.g., Enable-WindowsOptionalFeature -Online -FeatureName Sudo – note: exact command may vary; the preview documentation provides the exact syntax).
After enabling, any terminal session can use sudo <command>. The UAC prompt appears; confirming runs the command with elevated privileges.
Supported options
sudo disableInput– the elevated process receives no further keyboard input, reducing the risk of accidental privileged actions. sudo forceNewWindow – launches the elevated command in a new terminal window.
Additional flags may be added in future releases; they are not identical to Linux sudo semantics.
Comparison with existing Windows mechanisms
Windows already provides elevation via runas and the “Run as administrator” context‑menu. Those methods elevate an entire process or session, whereas sudo offers per‑command granularity similar to Unix, which is useful for developers who habitually use Linux tooling.
Open‑source implementation
The sudo feature is being developed as an open‑source project on GitHub (e.g., https://github.com/microsoft/windows-sudo). Users can clone the repository, inspect the source, and contribute.
Future outlook
Microsoft has indicated that sudo may be back‑ported to Windows 10, potentially making fine‑grained privilege escalation available on a broader set of devices.
Reference URLs:
https://www.theregister.com/2024/02/08/windows_11_sudo/
https://medium.com/young-coder/the-linuxification-of-windows-continues-0cb889255b97
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
