Last Updated on February 17, 2024 by Arnav Sharma
Microsoft’s latest addition to the Windows 11 Insider Preview Build 26052, “Sudo for Windows,” is a groundbreaking development for users and developers alike. This new command line tool is designed to enable users to run elevated commands directly from an unelevated console session, ushering in a new era of convenience and efficiency.
What is Sudo for Windows?
Sudo for Windows, a fork of the Linux sudo, is integrated into the Windows command line and PowerShell, allowing users to elevate permissions seamlessly. It’s a new way for users to run commands with elevated permissions without the need to switch to an elevated console. This tool is part of the Windows Insider Program’s continuous effort to bridge the gap between Windows and Linux operating systems, enhancing the functionality of the Windows command prompt and terminal.
How to Enable Sudo for Windows
To enable Sudo for Windows, users can simply go to the settings app, navigate to the ‘For Developers’ section in Windows Settings, and toggle on the “Enable Sudo” option. Alternatively, they can activate it by running the following command in an elevated console window:
sudo config --enable <configuration_option>. This feature is available to users running the Windows 11 Insider Preview and is part of Microsoft’s ongoing efforts to make Windows updates more user-friendly.
Sudo for Windows offers three main configuration options:
- In a New Window: The default setting, where the sudo command opens a new elevated console window to run the command.
- Input Closed: Runs the command in the current window but without accepting any further input.
- Inline: This mirrors the traditional Linux sudo experience, running the command directly in the current window and allowing for interaction.
The UAC Prompt
A key feature of Sudo for Windows is the integration of the User Account Control (UAC) prompt. When you run a command elevated using sudo, a UAC dialog will appear, asking for permission to proceed. This ensures security is not compromised while providing the ease of elevating commands directly from an unelevated console session.
Open Source Initiative
In an exciting move, Microsoft is working on open-sourcing Sudo for Windows. The repository is available on GitHub, inviting developers and users to contribute, review, and enhance the tool. This initiative aligns with Microsoft’s broader strategy to integrate open-source elements into the Windows OS.
Github link: GitHub – microsoft/sudo: It’s sudo, for Windows
Understanding the security implications of running sudo in different configurations is crucial. For instance, when sudo is configured to run in a new window, it mimics the behavior of the traditional runas command, but with added benefits like maintaining the same working directory and environment variables.
Community Feedback and Expansion
Since its announcement in the Windows Insider Program, Sudo for Windows has sparked diverse opinions from users accustomed to the Linux sudo and those familiar with the Windows command line. Microsoft is actively seeking feedback, especially concerning the security implications of running sudo in various configurations.
As part of Microsoft’s commitment to enhancing the Windows command line experience, they are expanding documentation for Sudo for Windows. Future updates and improvements are expected as Microsoft continues to refine this tool, making it an integral part of both Windows Server and Windows OS environments.
Sudo for Windows represents a significant step forward in aligning the command line experiences of Windows and Linux. It offers a new way for users to run elevated commands directly from unelevated terminal windows, simplifying the process and enhancing productivity. As part of the Windows 11 Insider Preview Build 26052, this feature marks a new era in Microsoft’s approach to operating system development, blending user convenience with robust security measures.
Q: What is the purpose of Gerardo Grignoli’s gsudo in the Windows environment?
AA: Gerardo Grignoli’s gsudo is a tool designed for Windows that functions similarly to the traditional sudo command found in Linux. It elevates a command in the command-line, allowing users to run a command in that window with elevated privileges. Gsudo, which has a number of additional features and configuration options, is a way to run commands with elevated permissions in the Windows Terminal, acting as a new sudo instance for Windows users.
Q: How does the integration of WSL enhance the use of sudo on Windows?
AA: The integration of Windows Subsystem for Linux (WSL) into Windows is a new way that significantly enhances the functionality of using sudo on Windows. WSL allows you to run Linux distributions and their native commands within Windows, including the use of sudo. This integration means that users running Windows, especially those running Windows 11 Insider Preview, can leverage WSL to execute Linux commands in a Windows environment, including the ability to use sudo.
Q: What are the benefits of using gsudo compared to traditional sudo commands?
AA: Gsudo offers several benefits over the traditional sudo command present in Linux environments. Firstly, gsudo is specifically designed for Windows and will be sharing a number of additional features and configuration options that are not necessarily present in sudo for Linux. These features enhance user experience and functionality in a Windows-specific context. Additionally, gsudo allows Windows users, particularly those on the Insiders build with sudo, to elevate commands directly from the Windows Terminal or PowerShell, providing a more integrated and seamless experience.
Q: Can you explain the process of setting up sudo capabilities in the Windows environment?
AA: Setting up sudo capabilities in the Windows environment involves a few steps. Firstly, creating an account on GitHub is recommended to access tools like gsudo. Then, check out Gerardo Grignoli’s gsudo, which can be downloaded and installed to provide sudo capabilities. For users running Windows 11 Insider Preview, the process may be simpler as they might have new sudo-like command features integrated directly. Additionally, configuring the Windows Settings app and Windows Terminal to use sudo or powershell sudo can further streamline the process, allowing users to elevate a command directly from their command line interface.