Here Are the Two Ways to Enable Sudo in Windows 11 (Using Settings or CMD)

What to know

  • As of February 09, 2024, the Sudo feature is available only in Windows 11 Canary version 26052. 
  • To enable Sudo, go to Settings > System > For developers > toggle on the Sudo option. Next, choose from either of ‘In a new window’, ‘With input disabled’, and ‘Inline’. 
  • Alternatively, run the command sudo config --enable <configuration_option> in an elevated console session.

Windows 11 now lets developers use sudo commands to run elevated programs without first opening elevated console sessions. Here’s everything you need to know to enable Sudo.  

How to enable Sudo on Windows 11

The ability to use Sudo is a recent development on Windows 11. So, make sure you fulfill the following requirements first:

Requirements

  • As of February 09, 2024, you need Windows Insider Preview with Canary build 26052.

Method 1: From the Settings app

  1. Open the Settings app. Then navigate to System > For developers.
  2. Toggle on Developer Mode.
  3. Click Yes to confirm.
  4. Scroll down and toggle on Enable sudo.
  5. Click Yes to confirm.
  6. You can further configure how sudo runs applications in three different modes. From the drop-down menu, choose from In a new windowWith input disabled, and Inline.
  7. Of the three available configurations, “Inline” is the closest to Linux’s sudo mode.

Method 2: From an elevated console session (like CMD)

Here’s how to enable Sudo using the command prompt. In this case, you don’t need to enable Developer Mode in Settings as we did above. Moreover, after enabling Sudo mode via CMD, you will still have the Developer Mode turned off in the Settings app. So, this is a good reason to use this method.

  1. Open an elevated command prompt window. (Press the Windows key and search CMD. Next, select Run as administrator. 
  2. Type the following command: sudo config --enable <configuration_option>

    Replace <configuration_option> with the sudo configuration you’d like to use. Type forceNewWindow to make Sudo use a new window, or type disableInput to keep input closed in Sudo, and finally, type normal to keep Sudo inline.
  3. Hit Enter.

FAQ

Let’s take a look at a few commonly asked questions about enabling Sudo on Windows 11.

What are the three configuration options for Sudo on Windows 11?

The three configuration options for Sudo include – In a new window (forceNewWindow), Input closed (disableInput), and Inline (normal). Use the options in the brackets when configuring Sudo on an elevated console.

When will Sudo be available on Windows 11 on general builds?

Sudo is already available on Windows 11 Canary builds. It will be released gradually to stable builds over the course of the year.

We hope you were able to enable Sudo on Windows 11 and use the privilege of running elevated programs without having to run elevated console sessions first. Until next time!

Leave a Reply

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