Microsoft announced the addition of sudo functionality in the latest Windows 11 Insider Preview build. sudo is a command line command familiar to Linux users that allows you to run programs using another user’s elevated security privileges.
“Sudo for Windows is a new way for users to run elevated commands directly from a non-elevated console session. This is an ergonomic and familiar solution for users who want to elevate a command without having to first open a new elevated console,” wrote Jordi Adoumie, product manager for Windows Developer Platform. blog post.
According to Microsoft, its version is a Windows-specific implementation, not a fork of the Linux sudo project. Therefore, some elements will differ and scripts and documentation written for Linux Sudo may not apply to Sudo for Windows.
Sudo for Windows can be enabled by visiting the “For Developers” page under Windows Settings and enabling “Enable Sudo”. There is also a command that can be used to enable it directly from an elevated console session: “sudo config –enable
Currently, Sudo For Windows supports three configuration options: in new window, close typing, and inline. The first option opens a new elevated console window and runs the command in that window. The second option runs the process in the current window, but the new process is spawned with “stdin” closed, meaning the new process cannot accept new user input. The third option most closely mimics the behavior of sudo on other systems and runs the elevated process such that it can accept input and route output in the current window.
Microsoft also announced that it will open source the Sudo for Windows project and release more information about it in the coming months.
More information is available about the project GitHub page.