The sudo command is coming to Windows 11
The sudo command is coming to Windows 11
Sudo, short for "substitute user, do", allows executing commands with elevated privileges to install applications, uninstall components, change settings, and perform other advanced tasks. Sudo is a command in Unix systems and Unix-based operating systems such as Linux, macOS, and some BSDs. Using sudo, users can perform tasks that require special permissions without logging in as root.
At the beginning of 2024, the Windows enthusiast community accidentally discovered the first clues about the appearance of the sudo command on Windows 11. Now, we have more details thanks to one of the builds. preview of Windows Server 2025 (this command is expected to be available in consumer versions of Windows 11).
Microsoft has not yet officially announced sudo for Windows, so details of the plan and implementation are still quite vague. However, screenshots provided by @thebook on X (Twitter) have revealed some interesting information.
Getting sudo to work on Windows 11 will require activating Developer Mode, a popular feature among app creators and Windows enthusiasts who want to access additional features. Windows 11 will then allow you to enable sudo and configure command behavior. There will be an additional prompt asking to confirm that you understand the risks of using the sudo command.
Available options for configuring sudo on Windows 11 will reportedly include "In a new window" (elevated command launches in new window), "With input disabled" and "Input route" (run the command in the same window).
Interestingly, third-party projects like gsudo have allowed users to use sudo on modern versions of Windows to elevate privileges in an existing or new console window.
Which Windows versions can run sudo commands?
Microsoft is adding the sudo command to Windows 11 considering that support for Windows 10 is ending soon, but we don't expect to see this command appear anytime soon. At the time of writing, the sudo command is only available to Windows Insider participants (build 26045 and above), specifically those on the Developer and Windows Canary channels.
Unlike some of the features Microsoft tested in these versions, it looks like sudo will be coming to the operating system soon.
How to enable sudo command on Windows
If the sudo command is not yet available for your version of Windows, you need to sign up for Windows Insider. This is a simple process, but be warned: Developer and Canary options can be unstable, so don't use them on a PC where you don't want to lose data.
When you are running a version of Windows that has the sudo command available, activating the command is a simple process. Open the Settings app, then select System on the left and For developers from the main area of the window.
Here, scroll down and enable the checkbox that says Enable sudo.
Enable sudo via Command Prompt
If you're more command-line oriented, you can also enable sudo via Command Command. Ironically, this requires you to run a CMD window with admin rights. Press the Windows key, type "command", then right-click Command Prompt (or PowerShell) and select Run as administrator.
In this prompt, run the following command:
sudo config --enable enable
How to use sudo command on Windows
After activating the sudo command on Windows, usage is very simple. Just add sudo to any commands you typically need to run with admin rights, then accept the next prompt.
An example from Microsoft using the netstat command:
sudo netstat -ab
This feature may seem a bit unnecessary - and for many people it is. That said, if you spend all day running command after command on Windows and long for the simplicity of the sudo command, its addition will make your life easier.
Microsoft seems certain to implement sudo, even going so far as to release sudo on GitHub as open source. If this information makes you want to learn more about what goes on in Windows, make sure to check out this list of commands every Windows user should know.
You should read it
- Linux Error SUDO allows you to run commands as root
- How to use sudo without password in Linux
- How to reset the password for sudo in Debian
- Enable Root account in Ubuntu
- 20+ essential Linux security commands
- Basic Linux commands everyone needs to know
- Sub-commands in the nslookup Windows command (Part 1)
- Sub-commands in nslookup Windows command (Part 2)
- Sub-commands in nslookup Windows command (Part 3)
- Command at in Windows
- Set command in Windows
- Del command in Windows