For years, the sudo command was exclusive to Linux and macOS environments. With the release of Windows 11 version 24H2, Microsoft has officially brought its own implementation of sudo to the platform.

This isn’t just a simple port. It’s a brand-new version, built from scratch, open-source under the MIT license, and deeply integrated into the system.

It might fly under the radar for casual users—but for developers, sysadmins, and power users, it’s a meaningful upgrade that simplifies how elevated commands are executed.

How to Enable and use Sudo in Windows 11

What Is Sudo?

The term sudo comes from the Unix world and stands for “superuser do.”

It allows a standard user to run a specific command with administrator privileges—without switching accounts or launching a full admin session.

Instead of opening an entire terminal as administrator, sudo elevates only the command you need. That’s what makes it efficient and practical.

Why Sudo Matters on Windows

On Windows, many tasks require admin rights. Traditionally, you had to:

  • Right-click the terminal
  • Select Run as administrator
  • Open a new elevated window

That works—but it’s not efficient when you only need to run one command.

Windows already had an alternative: runas. However, it works differently:

  • It runs programs as another user
  • It may require credentials
  • It’s less direct for quick elevation

With sudo, Windows finally gets a cleaner, more modern approach.

Practical Examples

Here are some real-world use cases:

sudo netstat -ab

View active network connections with associated processes.

sudo notepad C:\Windows\System32\drivers\etc\hosts

Edit the hosts file without opening a separate admin window.

sudo diskpart

Launch disk management tools with elevated rights.

sudo npm install -g package-name

Install global Node.js packages without switching sessions.

How to Enable Sudo on Windows 11

By default, sudo is disabled in Windows 11.

Enable via Settings

  1. Press Win + I to open Settings
  2. Go to System → Advanced
  3. Toggle Enable sudo to ON
  4. Confirm the UAC prompt

Enable via Terminal

You can also activate it using an elevated terminal:

sudo config --enable forceNewWindow

You can replace forceNewWindow with other modes depending on your preference (explained below).

⚠️ Note: This feature is only available in Windows 11 version 24H2 or later.

The 3 Sudo Modes Explained

Once enabled, you can choose how sudo behaves.

1. New Window Mode (forceNewWindow)

  • Runs commands in a separate elevated terminal
  • Safest option
  • Recommended for beginners

2. Disable Input Mode (disableInput)

  • Runs in the same window
  • Blocks input interaction with the elevated process
  • Balanced between usability and security

3. Inline Mode (normal)

  • Runs directly in the current terminal
  • Closest to Linux behavior
  • Most convenient—but least secure

You can switch modes via command line:

sudo config --enable normal

Is Sudo on Windows Safe?

There’s a reason Microsoft keeps it disabled by default.

Depending on the mode, sudo can introduce security risks—especially in shared or professional environments.

  • New Window mode: safest (isolated execution)
  • Disable Input mode: safer, limits interaction
  • Inline mode: most exposed

In Inline mode, a background process could potentially interact with an elevated command running in the same terminal.

What Should You Use?

  • Personal PC → Inline mode is generally fine
  • Work or shared systems → Stick with New Window mode

Final Thoughts

Bringing sudo to Windows 11 may seem like a small addition—but it’s a big quality-of-life improvement for advanced users.

Instead of juggling multiple terminal windows, you can now elevate commands instantly, just like on Linux or macOS.

It’s faster, cleaner, and more flexible—especially if you regularly work with development tools or system-level commands.

Just remember: with great power comes responsibility. Choose the right mode, and use it wisely.

Support Tech2Geek ❤️

AI-powered search engines are making it harder for small independent blogs like ours to survive. If you find our guides helpful, please consider supporting us.

You can help by sharing our articles or making a small donation.

☕ Make a Small Donation

Every contribution helps us keep creating free tech guides and reviews.

Categorized in: