How to Enable or Disable Sudo for Windows 11

This tutorial demonstrates how you can enable or disable sudo for Windows 11. The sudo command in Windows allows the user to run elevated commands directly from an unelevated console session.

In the Windows 11 Insider Preview build 26052, Microsoft first announced the Sudo feature for users. The Sudo is an open-source project that is maintained separately on GitHub, where you can get more information about the changes and features being added.

If you have previously used the Sudo on Unix or Linux OS, you have to understand that it works differently in Windows 11. Although the concept of Sudo remains the same, the implementation varies for Windows operating systems.

Install and Update Third Party Applications with Patch My PC
Install and Update Third Party Applications with Patch My PC

Prerequisites

  • To use the Sudo command in Windows 11, you’ll have to first enable it from the Settings > For Developers. You can also use the alternate methods covered in this guide.
  • You must be using Windows 11 Insider Preview Build 26052 or higher.
  • To access the preview builds, you must join the Windows Insider program.
  • According to Microsoft, Sudo for Windows is not yet available for Windows 10, but it may be added in the future.

Note: Running the sudo command could expose your device and personal data to security risks or harm your device. Hence, enable it with caution and turn it off when not required.

Also See: How to Enable or Disable Developer Mode in Windows 11

Enable or Disable Sudo for Windows using Settings

To enable Sudo for Windows, navigate to the Settings > For Developers page in Windows Settings. Here, set Enable Sudo to On to activate it.

After enabling the sudo command in Windows, you can configure how sudo runs applications. You can choose to run it in a new window, with input disabled, or inline. By default, Sudo runs applications in a new window.

Enable Sudo for Windows using Settings
Enable Sudo for Windows using Settings

To disable the Sudo on Windows 11, go to Settings > For Developers page and set Enable Sudo to Off. You don’t have to restart your device after making the changes.

Disable Sudo for Windows using Settings
Disable Sudo for Windows using Settings

Enable or Disable Sudo using CMD Prompt

From the Windows command prompt, you can quickly turn on or disable the Sudo command in Windows 11.

Launch the Command Prompt as an administrator. Enter the below command to turn on the Sudo for Windows.

sudo config --enable [value]

In the above example, when you attempt to enable the sudo with the command sudo config –enable, a value is required for –enable. Hence, you must enter the possible values. The Sudo config accepts the following possible values:

  • disable
  • enable
  • forceNewWindow
  • disableInput
  • normal
  • default

Running the below command enables the sudo and configures the applications to run in a new window.

sudo config --enable forceNewWindow

After running the above command, you see the message “Sudo is currently in Force New Window mode on this machine.

Enable Sudo using CMD Prompt
Enable Sudo using CMD Prompt

Run the following command to enable the sudo and configure the applications to run in inline mode.

sudo config --enable default

After running the above command, you see the message “Sudo is currently in Inline mode on this machine.

Enable Sudo using CMD Prompt
Enable Sudo using CMD Prompt

On Windows, to disable the sudo, run the following command in the CMD prompt.

sudo config --enable disable

The message “Sudo is disabled on this machine” in the command prompt confirms you’ve successfully turned off Sudo for Windows.

Disable Sudo using CMD Prompt
Disable Sudo using CMD Prompt

Turn on or off Sudo command using Registry

Windows registry is another method that you can use to activate or disable the Sudo command on Windows 11.

On the Windows PC, open the registry editor by running the command “regedit.exe“. In the registry editor, navigate to the following path:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Sudo

Double-click the “Enabled” DWORD and set the value to 1. This will activate Sudo on your Windows 11 PC.

Enable Sudo command using Registry
Enable Sudo command using Registry

Using the Registry, you can turn off the Sudo when not required. Open the registry editor on Windows 11 and navigate to the below path:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Sudo

Double-click the “Enabled” DWORD and set the value to 0. This will disable Sudo for Windows 11.

Disable Sudo command using Registry
Disable Sudo command using Registry

Enable or Disable Sudo for Windows using PowerShell

On Windows 11, you can enable or disable the sudo command using PowerShell. To enable the Sudo command for Windows, run the following PowerShell command.

sudo config --enable enable
Enable Sudo for Windows using PowerShell
Enable Sudo for Windows using PowerShell
sudo config --enable disable
Disable Sudo for Windows using PowerShell
Disable Sudo for Windows using PowerShell

Conclusion

In this tutorial, we have covered different methods with which you can enable or disable Sudo for Windows. These methods include command prompt, PowerShell, Windows Registry, and Windows Settings. Although Sudo has yet to be included in the regular version of Windows, enthusiasts can test it out in Insider preview builds. Let us know your experience with the Sudo command in Windows.

Need more help?

If you need further assistance on the above article or want to discuss other technical issues, check out some of these options.