I have a test machine with Windows Server 2022 installed, and I have downloaded the PsTools folder from the official website with PsExec.exe in it, I also enabled OpenSSH server on the machine.
Then I SSH to the test machine from another client, change directory to PsTools, then launch PsExec.exe without any parameters.
Normally it should print with some available parameters that should be used together with psexec, but I can only see the first 3 lines:
PS C:\Tools\PSTools> .\PsExec.exe
PsExec v2.43 - Execute processes remotely
Copyright (C) 2001-2023 Mark Russinovich
Sysinternals - www.sysinternals.com
I tried both Command Line and PowerShell as the default shell for OpenSSH, the same result.
Am I missing something?
PS: I tried the same operations on another Windows 10 (run psexec.exe via SSH), and everything works fine.
I found the solution from another question...the answer is quite simple and straightforward...which I should have thought of
PSexec on remote machine hangs running from Teamcity
Thanks to @Be.St.
adding -accepteula
solved my problem!