Microsoft has introduced the ability to use sudo on Windows 11, allowing users to execute commands with administrative privileges directly in the terminal window. This feature, however, is not enabled by default.
How to Enable and Use
To activate sudo, navigate to Windows Settings, then System > Advanced and toggle Enable sudo. Microsoft provides three modes: In a new window, With input disabled, and Inline. Users can enable these modes through settings or the command sudo config --enable normal in an elevated terminal. Once enabled, prefix commands with sudo to execute them with admin rights, such as sudo winget upgrade --all and sudo notepad C:\Windows\System32\drivers\etc\hosts. Each action will prompt a User Account Control (UAC) confirmation.
Key Differences from Linux
While sudo enhances administrative capabilities on Windows 11, it operates differently from its Linux counterpart. Windows requires a UAC prompt for each command, lacks credential caching, and elevates processes individually rather than globally switching users. Third-party tools like gsudo may offer more advanced features, such as credential caching and detailed control over permissions.
Practical Benefits
The addition of sudo in Windows 11 presents a significant improvement for developers and users transitioning between Windows and Unix-like systems. It simplifies the process of running administrative commands without needing to open multiple elevated terminal windows, streamlining workflows for tasks that require higher privileges.



