Search code examples
windowssshpermissionsadminopenssh

WIndow's ssh service defaults to admin permission


Connecting remotely into a windows machine using the OpenSSH service provided by windows always starts an elevated session. Is it possible to start a non elevated session and elevate after the fact? if so how?


Solution

  • Based on this github discussion: https://github.com/PowerShell/Win32-OpenSSH/issues/1652
    bagajjal:

    For admin users, ssh connection is an elevated session. Given you are an admin and has elevated session, you can write to c:\windows.

    This is by design.

    jborean93:

    The biggest issue when you were to use the limited token after an SSH logon is that you cannot then get your elevated token. On an interactive logon you can right click and say Run as administrator and confirm through the UAC prompt but on a network logon like SSH there is no way for UAC to prompt you. So if this was a functionality you will never be able to swap from the limited to full token of your admin account.