How to Enable Sudo Command in Windows 11?

0 Comments
Editor Ratings:
User Ratings:
[Total: 0 Average: 0]




This post explains how to enable Sudo command in Windows 11. Sudo stands for “Superuser do”. It is a Linux operating system utility that allows users to execute commands with the security privileges of another user. The other user is usually a superuser or root. This lets users perform tasks such as system configuration, software installation, and file manipulation that require administrative access without needing to log in as the root user.

Microsoft has added the sudo command to the latest Insider build of Windows 11. This implementation is a Windows-specific implementation of the sudo concept and is not related to the Unix/Linux sudo project. You can enable Sudo for Windows from the system settings and run the command through Command Prompt. Windows implementation of Sudo is not as seamless as it is on Linux. Its functionality is limited as of now with a roadmap of improvements over time. With that said, let’s see how to enable and use it in Windows 11.

Also, check our other guides to Enable Linux Bash Shell with WSL 2 on Windows and Run GUI apps on Windows System for Linux.

Enable Sudo Command in Windows 11?

Sudo for Windows is released officially in the latest insider build for Windows 11. To get this feature, you need to be enrolled in the Windows Insider Preview program. You also have to update your Windows build to number 26020 or later. When you are running the latest build, you can enable the sudo from the system settings.


To do that, launch the “Settings” app on Windows 11 and pick the “System” settings from the navigation panel. Scroll down to the “For developers” settings and click it open. Look for the “Enable sudo” setting there and click on it to enable. This shows a popup on the screen mentioning the potential harm of enabling sudo. Click Yes in the popup to enable the sudo command on your Windows 11.

Run Sudo Commands on Windows 11

After enabling sudo, you can run the sudo commands through Command Prompts. All you have to do is open the Command Prompt with Administrative privileges and type your commands there to run.

Sudo Limitations on Windows

Sudo allows you to access restricted files and operations without logging in as a root user. However, this is not possible in the Windows version of sudo. Certain elements of the traditional sudo experience are not present in Sudo for Windows. To run sudo commands, you have to run Command Prompt as Adminstrator. Unlike Linux, Windows’ implementation of sudo relies on UAC and runs commands as administrator only. Another shortcoming of sudo on Windows is that it launches different commands in new windows instead of running everything in the same window.

Try Sudo on Older Windows versions

This new sudo implementation is not limited to Windows 11 only. You can easily get the same functionality on older versions of Windows including Windows 10, Windows 8/8.1, and Windows 7. This is possible with the “Sudo.exe” file under the System32 directory.

To get sudo on older Windows versions, you need the “Sudo.exe” file from the Windows 11. You can find this file under the Sytsem32 Windows directory (OS Drive -> Windows ->System32).

Simply copy this “Sudo.exe” file from Windows 11 and paste it into the same directory on the older Windows version. Once done, you can use the sudo commands through the Command Prompt.

Running the sudo command on an older Windows version says that the functionality is disabled and you have to enable it from the settings. However, you can execute your commands and it would run just fine, the scope might be limited though.

Closing Words

The implementation of sudo in Windows is a welcome feature. This can benefit developers to run tools with elevated privileges with ease. However, sudo on Windows and Linux are quite different. Linux sudo is flexible and highly configurable whereas Windows sudo is limited and runs commands as administrator only. But this is just the initial implementation that is being tested. Microsoft has a roadmap to streamline it along the way when it enrolls in regular versions of Windows 11 later this year. You can view the project on GitHub for updates. This sudo implementation is limited to Windows only as Microsoft clarified that it is not coming to Windows Server 2025.

Editor Ratings:
User Ratings:
[Total: 0 Average: 0]
Free/Paid: Free

Leave A Reply

 

Get 100 GB FREE

Provide details to get this offer