How to Enable and use Sudo in Windows 11

As of February 09, 2024, Windows 11 has introduced a new feature allowing developers to use sudo commands, akin to Linux, to run elevated programs without needing to open elevated console sessions first. This guide will walk you through enabling and using Sudo in Windows 11, in a straightforward and relaxed manner. Please see Add a User to the Sudoers List in Linux, and SU Authentication Fix: Sudo Permission Denied in Ubuntu.
Please see these related guides: Sudo Error on Ubuntu: Fixing ‘unknown uid 1000: Who are you?’, KB5034439 Windows Update Error: Resize WinRE Partition, Fix “Getting Windows Ready” Don’t turn off your computer stuck on Windows, Fix 0x800f0831 Error when installing Windows update.
Sudo Requirements in Windows
Before diving in, make sure you have the following: Windows Insider Preview with Canary build 26052 (released on February 09, 2024).
Enabling Sudo on Windows 11
Method 1: Using the Settings App
Press the Windows key, type or select “Settings,” from the Start menu.

Go to System > For developers.

Toggle on Developer Mode.

Click “Yes” to confirm.

Scroll down and toggle on the “Enable sudo” option.

Click “Yes” to confirm.

Configure Sudo:
Choose how you want Sudo to run applications from the drop-down menu. You have three options:
- In a new window: Opens the application in a new window.
- With input disabled: Disables input in the Sudo session.
- Inline: Runs the application inline, similar to how sudo works on Linux.
You can read more about the security considerations for each mode on devblogs.microsoft.com before enabling the sudo command on your machine.
Here are some related articles: How to Change User Account Type in Windows 10, how to Find and remove Malware with Microsoft Defender Offline, and how to fix “Preparation failed: Error during connect in the default daemon configuration on Windows, the docker client must be run with elevated privileges“.
Method 2: Using an Elevated Console Session
If you prefer command-line interfaces, you can enable Sudo via the command prompt. This method doesn’t require enabling Developer Mode in the Settings app.
Press the Windows key, type “CMD,” right-click on Command Prompt, and select “Run as administrator.”

To enable Sudo, type the following command:
sudo config --enable <configuration_option>

Replace <configuration_option> with your preferred configuration:
- forceNewWindow: Runs Sudo in a new window.
- disableInput: Runs Sudo with input disabled.
- normal: Runs Sudo inline (similar to Linux).
Press Enter to execute the command.
You may also want to see: Error 740: Elevated permissions are required to run DISM, how to Install MSSQL 2019 Developer Edition and SSMS on Windows, and How to create a Recovery Partition in Microsoft Windows 10/11.
Conclusion
By following this guide, you can streamline your workflow and take full advantage of this new feature in Windows 11. Enjoy the enhanced flexibility and control that Sudo brings to your Windows experience!
I hope you found this article on how to enable and use Sudo in Windows 11 useful. Please feel free to leave a comment below.