-
Notifications
You must be signed in to change notification settings - Fork 802
Description
"OpenSSH for Windows" version
((Get-Item (Get-Command 'C:\Program Files\OpenSSH\OpenSSH-Win64\sshd').Source).VersionInfo.FileVersion)
8.1.0.0
Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName).ProductName)
Windows Server 2019 Datacenter
Client OperatingSystem
n/a
What is failing
I am unable to run an AuthorizedKeysCommand binary under the Windows SYSTEM account. However, I can run it under another account with Administrator privileges. I would prefer to not need a separate/default Administrator account to run the command, since users may be allowed to SSH into a brand new Windows image with no active Administrative accounts.
Expected output
AuthorizedKeysCommandUser set to user account w/ Administrator privs
6328 2020-02-04 22:30:44.331 debug1: C:\ProgramData\ssh\ak.cmd:3: matching key found: RSA SHA256:
6328 2020-02-04 22:30:44.331 debug1: C:\ProgramData\ssh\ak.cmd:3: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
6328 2020-02-04 22:30:44.331 Accepted key RSA SHA256: found at C:\ProgramData\ssh\ak.cmd:3
6328 2020-02-04 22:30:44.331 debug1: auth_activate_options: setting new authentication options
6328 2020-02-04 22:30:44.331 Accepted publickey for rofuentes from port 43000 ssh2: RSA SHA256:
6328 2020-02-04 22:30:44.331 debug1: monitor_child_preauth: rofuentes has been authenticated by privileged process
6328 2020-02-04 22:30:44.362 debug1: auth_activate_options: setting new authentication options [preauth]
Actual output
AuthorizedKeysCommandUser set to SYSTEM
6268 2020-02-04 21:37:52.209 error: lookup_principal_name: User principal name lookup failed for user 'nt authority\system' (explicit: 1212, implicit: 1212)
6268 2020-02-04 21:37:52.209 debug1: generate_s4u_user_token: LsaLogonUser() failed. User 'nt authority\system' Status: 0xC0000062 SubStatus 0.
6268 2020-02-04 21:37:52.209 error: lookup_principal_name: User principal name lookup failed for user 'nt authority\system' (explicit: 1212, implicit: 1212)
6268 2020-02-04 21:37:52.209 debug1: generate_s4u_user_token: LsaLogonUser() failed. User 'nt authority\system' Status: 0xC0000062 SubStatus 0.
6268 2020-02-04 21:37:52.209 error: get_user_token - unable to generate token on 2nd attempt for user nt authority\system
6268 2020-02-04 21:37:52.209 error: unable to get security token for user nt authority\system
6268 2020-02-04 21:37:52.209 fatal: posix_spawn: eother