Microsoft is bringing another Linux feature to Windows… although it’s an optional feature aimed at power users. Sudo for Windows is a command line tool that works a lot like its Linux counterpart, allowing users to run commands that require elevated permissions on a case-by-case basis.
In other words, you don’t need to right-click and choose “run as administrator” or open up a command prompt that has administrator privileges. You can open a normal command prompt or terminal windows and then type “sudo” at the start of any command that needs escalated privileges.
Sudo for Windows doesn’t work exactly like the Linux version. Instead of prompting you for a password, for example, Sudo for Windows will bring up the Windows User Account Control pop-up dialog asking you if you for confirmation before executing the tasks.
It’s also an entirely optional feature that needs to be enabled. Sudo for Windows is currently available for members of the Windows Insider program running Windows 11 preview build 26052. If that’s you, then you can open Windows Settings, navigate to the System > For Developers area, and then flip the toggle to “Enable sudo.”
Windows Insiders can also enable the feature by opening a command prompt and typing:
sudo config --enable <configuration_option>
Configuration options include “normal,” “forceNewWindow,” or “disableInput:”
- Normal or “inline” mode will allow you to run elevated commands in the same window where you type them.
- forceNewWindow does what it says on the tin: the command will open a new elevated terminal window where the task will be executed.
- disableInput also allows elevated commands to run in the same window, but no further user input is accepted at an elevated level. So if you’re running a task that requires additional input, this may not be the best option.
Microsoft has made Sudo for Windows an open source project: there’s a GitHub repository for the project.
Keep in mind that if you’re not a member of the Windows Insider program, then you cannot use this feature yet. But it will likely make its way to a stable release of Windows in the future.
Meanwhile, Sudo for Windows isn’t the first open source sudo implementation for Microsoft’s desktop operating system. Developer Gerardo Grignoli’s gsudo has been around for years, and while it’s not as tightly integrated with the operating system’s system settings as Microsoft’s implementation, Microsoft notes that gsudo has “additional functionality that Sudo for Windows does not provide,” and more configuration options. So the company recommends users looking for more features check it out.