Some days ago we echoed from the discovery of a specialized site of an implementation of the sudo command in Windows. Now Microsoft confirms sudo for Windows. What we didn't know, and it's great news, is that Microsoft will make its Sudo implementation open source.
Actually, there was already an implementation done by an independent programmer, and it is the Sudo developers themselves at Microsoft who recommend using it if you need more features than the official version.
But, let's talk about Microsoft's announcement first and then we get into the alternative.
Microsoft confirms sudo for Windows
Jordi Adoumie, Product Manager for the Microsoft Developer Platform, published on the official blog the characteristics of the new function are quite consistent with what the Windows Latest people deduced from a few windows.
The sudo command will temporarily allow users to have administrator privileges without needing to enable them as administrator users. It will be available starting with Windows 11 Insider Preview Build 26052!.
It can be enabled graphically from the Developers section of the Configuration or from the command line or PowerShell by typing as administrator:
sudo config --enable <configuration_option>
This last parameter allows 3 variants:
- In a new window.
- Closed income.
- Current window.
in a new window
Open a console with administrator privileges. It is the default mode.
Closed income
In this configuration mode, sudo for Windows Run the process with privileges in the same window, but with its stdin closed. Stdin is an acronym that we owe to the creators of the C programming language and refers to the English expression "standard input" (We can translate it as standard input). For most operating systems and programming languages, the aforementioned expression refers to the flow of data that is generated by the keyboard or mouse or sent by another process.
That is, in this sudo configuration, the new process will ignore any user input. Hence, this modality should not be used in those processes that, in addition to administrator privileges, require interaction with the user.
When the user decides to use the sudo command, the UAC asks for confirmation. UAC is the acronym that identifies the Windows user account control system. The UAC verifies user credentials and asks for confirmation when they intend to make changes to the system.
Current window
Perhaps the way Sudo behaves most like its Unix big brother. ANDThe process is executed in the current window as are the inputs, outputs and error messages.
gsudo
I told you before that there was a tool with more features than Microsoft's Sudo. It was developed by an independent programmer and appears to be more similar to the original Sudo. Additionally, it can be used on Windows 10.
According to the description of page on the project's GitHub, gsudo is the equivalent of the Unix sudo command providing a similar user experience. The user just has to prefix gsudo or sudo to the command to be able to run it as an administrator user to convert the command line to an administrator one.
Each time gsudo is run, the UAC window will appear asking for confirmation, but this can be changed. gsudo works with Cmd, PowerShell, WSL, git-bash, MinGW, Cygwin, Yori, Take Command, BusyBox and NuShell.)
A little bit of history
The sudo command is an acronym in English (which translates as "perform as superuser" in our language) We owe it to Bob Coggeshall and Cliff Spencer. They did it in 1980, in the computer science department of the State University of New York. The current maintainer is OpenBSD developer Todd C. Miller who distributes it under a BSD license.
The function of sudo is to allow users to execute commands with permissions higher than those originally assigned to them. It is used to perform administrative tasks or modify restricted files, without giving the user full system access