How to Enable the sudo Command in Windows 11

This guide will show you how to turn on or off the sudo command on Windows 11.

You might have used sudo on Linux or Mac computers. It lets you run commands with special permissions, like an administrator. Now, Windows 11 has added this command too, so you can use it just like on other systems.

Starting with
Windows Insider Build 26052 (Canary)
, the sudo command was introduced to make it easier to run commands as an administrator right from the command line.

What Are the Different Ways sudo Can Work?

  • In a new window: This opens a new window to run the command with administrator rights.
  • With input disabled: The command runs in the same window but doesn’t accept input while running.
  • Inline: The command runs in the same window and accepts input, like on Linux or Mac.

Using sudo in Windows makes it easier and faster to do tasks that need administrator permissions without switching users.

How to Enable sudo Using Windows Settings

Follow these simple steps:

  1. Open the Settings app.

    You can do this by:
    • Clicking the Start button and then Settings, or
    • Pressing Windows key + I on your keyboard.
  2. In Settings, click on System on the left side.
    System button in Settings appClick on System in Settings
  3. On the right side, find and click For Developers.
    For Developers tile in the Settings app

    Click on For Developers under System

  4. Find the option for Enable sudo and turn the switch to On to enable it.
    Enable sudo in the Settings app

    Turn on Enable sudo and choose your preferred mode

  5. You can also pick how you want sudo to work by selecting one of the three modes from the dropdown:
    • In a new window
    • With input disabled
    • Inline
  6. To turn off sudo, just switch the toggle to Off.

How to Enable or Disable sudo Using Windows Terminal (Command Prompt)

You can also turn on or off sudo by typing commands in the Windows Terminal app:

Enable sudo in “In a new window” mode:

sudo config --enable forceNewWindow

Enable sudo in “With input disabled” mode:

sudo config --enable disableInput

Enable sudo in “Inline” mode:

sudo config --enable normal

Disable sudo command:

sudo config --enable disable

Enable or Disable sudo Using Windows Registry Editor

If you are comfortable using the Registry Editor, you can also change sudo settings there.

  1. Open the Registry Editor.
  2. Go to this folder path:

    ComputerHKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionSudo
  3. Look for a value named Enabled on the right side. Double-click it to change its number.
  4. Use these numbers to choose a mode:
    • 1 – “In a new window” mode
    • 2 – “With input disabled” mode
    • 3 – “Inline” mode
    • 0 – Disable sudo
  5. If you don’t see Enabled, right-click on a blank space, choose New → DWORD (32-bit) Value, name it Enabled, and set its value to one of the numbers above.
Enable or disable sudo in Registry Editor
Set the Enabled value in Registry Editor to control sudo

After making changes in Registry, restart your computer for them to take effect.

sudo command in terminal console
Using sudo in Windows Terminal

Summary

  • Turning on sudo in Windows 11 helps you run commands as admin easily from the command line.
  • This makes your work faster and helps keep your computer safer by not needing to log in as an administrator all the time.

For more details, you can visit the official Microsoft blog.

Categories:

Tags:

Leave a Reply

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

Exit mobile version