PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.25k stars 745 forks source link

Start as unpriviliged user by default with sudo for Windows enabled systems #2251

Open matteodev8 opened 2 weeks ago

matteodev8 commented 2 weeks ago

Summary of the new feature / enhancement

Currently, when the user is assigned to Administrators, the ssh session will also be an Administrator session. This breaks some software like scoop.

Due to the development of sudo for Windows (https://github.com/microsoft/sudo), it would be a good idea to always start the session unprivileged. If the user needs Admin rights, they should use sudo instead.

Proposed technical implementation details (optional)

No response

jborean93 commented 2 weeks ago

One problem with starting as non-admin is you have no way of elevating to admin when you need it to. While there is now the sudo tool from Windows it still relies on the interactive UAC prompt to elevate the process which won't work on the non-interactive SSH logon session as there is no Windows GUI to display the prompt on. Unless Windows provides a way to get UAC working in a TTY like prompt then you are reliant on 3rd party tools to do the elevation.