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:

  1. In a new window: A new window will open in which the elevated command will run.
  2. 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.
  3. 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.

How to enable Sudo command in Windows 11

Method 1: Using Settings

1. Press Windows Key + 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.

Enable Sudo command in Windows 11 Using Settings

4. In the confirmation prompt, select Yes.

Enable Sudo command in Windows 11 Using Settings

5. Next, you can select the Sudo command mode from: In a new window, With input disabled, Inline.

Enable Sudo command in Windows 11 Using Settings

Method 2: Using registry

Registry Disclaimer: It is recommended to create a System Restore point first, if you’re not familiar with registry manipulation.

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.

Enable Sudo command in Windows 11 Using registry

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.

Enable Sudo command in Windows 11 Using Terminal

  • 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

Your email address will not be published. Required fields are marked *