With Windows 11 Preview Build 26052, Microsoft introduced Sudo for Windows. It is a new way for users to run elevated commands directly from an unelevated console session. It is an ergonomic and familiar solution for users who want to elevate a command without having to first open a new elevated console. In this guide, we’ll see how you can enable Sudo command in Windows 11.
The sudo command can be configured to run in three different modes:
- In a new window: A new window will open in which the elevated command will run.
- With input disabled: The elevated command will run inline with its stdin closed in the window from which you’ve triggered elevation. You will not be able to interact with the elevated process.
- Inline: The elevated command will run inline in the window from which you’ve triggered elevation. This mode is most similar to the sudo experience on other platforms.
You must be an administrator to enable Sudo command.
Page Contents
How to enable Sudo command in Windows 11
Method 1: Using Settings
1. Press + I keys to open Settings app.
2. In the Settings app, go to System > For developers.
3. Assuming you’ve signed into admin account, turn On the Enable sudo option.
4. In the confirmation prompt, select Yes.
5. Next, you can select the Sudo command mode from: In a new window, With input disabled, Inline.
Method 2: Using registry
1. Run regedit
command to open Registry Editor.
2. In the Registry Editor window, navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Sudo
3. In the right pane of Sudo, create registry DWORD named Enabled and set it following data:
- In a new window, set 1.
- With input disabled, set 2
- Inline, set 3.
Method 3: Using Terminal
1. Right click on Start button, select Terminal (Admin).
2. In the PowerShell tab, type either of commands:
- To enable Sudo command and select mode ‘In a new window’, run
sudo config --enable forceNewWindow
.
- To enable Sudo command and select mode ‘With input disabled’, run
sudo config --enable disableInput
. - To enable Sudo command and select mode ‘Inline’, run
sudo config --enable normal
.
That’s it!
Leave a Reply