Skip to content

Commit 5aa3f29

Browse files
Merge pull request #6125 from MicrosoftDocs/main639014317641368657sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 99e919f + 95c00d6 commit 5aa3f29

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

hub/advanced-settings/sudo/index.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,26 @@ Update `<configuration_option>` to either `forceNewWindow`, `disableInput`, or `
4949

5050
To use Sudo for Windows, simply prepend `sudo` to the command you want to run as an administrator. For example, to run `netstat -ab` as an administrator, you would run `sudo netstat -ab` in your console window.
5151

52+
### Common developer scenarios
53+
54+
Here are some common scenarios where developers might use sudo:
55+
56+
- **Editing system files**: `sudo notepad C:\Windows\System32\drivers\etc\hosts`
57+
- **Installing packages globally**: `sudo npm install -g package-name`
58+
- **Running administrative tools**: `sudo diskpart`
59+
60+
> [!NOTE]
61+
> For development work involving system directories like `C:\Windows\`, consider using development environments or alternative approaches when possible. Sudo should be used judiciously and only when elevated permissions are truly necessary.
62+
5263
Because `sudo` elevates the targeted process to run with administrator-level permission, a prompt will open asking you to verify that you want to continue.
5364

5465
## Security Considerations
5566

56-
There are risks associated with running sudo in the **Input closed** (`inputClosed`) or **Inline** (`normal`) configurations. It is possible for malicious processes to attempt to drive the elevated process using the connection established by the unelevated sudo.exe and the elevated sudo.exe process.
67+
There are risks associated with running sudo in the **Input closed** (`disableInput`) or **Inline** (`normal`) configurations. It is possible for malicious processes to attempt to drive the elevated process using the connection established by the unelevated sudo.exe and the elevated sudo.exe process.
5768

58-
The `inputClosed` configuration option mitigates risk by closing the input handle. Disconnecting the input handle from the current console window means that unelevated processes cannot send input to the elevated process.
69+
The `disableInput` configuration option mitigates risk by closing the input handle. Disconnecting the input handle from the current console window means that unelevated processes cannot send input to the elevated process.
5970

60-
The `inline` configuration option runs the elevated process in the current window and the process is able to receive input from the current console session. An unelevated process can send input to the elevated process within the same console windows or get information from the output in the current windows in this configuration.
71+
The `inline` configuration option runs the elevated process in the current window and the process is able to receive input from the current console session. An unelevated process can send input to the elevated process within the same console window or get information from the output in the current window in this configuration.
6172

6273
## FAQ
6374

@@ -75,7 +86,7 @@ The `inline` configuration option runs the elevated process in the current windo
7586

7687
- `sudo` can only be elevated via the User Account Control (UAC) security feature designed to protect the operating system from unauthorized changes using verification prompt.
7788

78-
You should consider your particular use-case and plan to use the command that best meets your needs. You should also consider the security implications of running sudo in the `inputClosed` and `normal` modes. The default `forceNewWindow` configuration option is recommended unless you are familiar and comfortable with the risks associated with the other `sudo` configurations.
89+
You should consider your particular use-case and plan to use the command that best meets your needs. You should also consider the security implications of running sudo in the `disableInput` and `normal` modes. The default `forceNewWindow` configuration option is recommended unless you are familiar and comfortable with the risks associated with the other `sudo` configurations.
7990

8091
## Sudo for Windows open source repository
8192

0 commit comments

Comments
 (0)