I am connecting via SSH to a windows host running Cygwin SSHD (OpenSSH) server.
I would like to run powershell scripts on it remotely.
I did try several versions of SSH servers based on OpenSSH and none of them worked so far. (Cygwin SSH, CopSSH, RedHat Cygwin SSH).
The problem is that after connecting (via SSH) and executing powershell.exe, the console does not return to the command prompt (does not accepty any input at all).
The only way to break the freeze is to do CTRL-C.
Powershell scripts that do not require any console input (e.g. do not ask (Y/N) question) run OK with this command (-n option):
ssh.exe -n user@mysshserver "powershell.exe C:\\\testdir\\\some_script.ps1" (command typed in PS command prompt on the SSH client side)
Note: if a powershell script requires input (let's say the "some_script.ps1" has command "Read-Host" in it), it will freeze too.
When I make a full connection though (ssh.exe user@myserver) the console doe not come back to the command prompt by running any PS script. (CTRL-C is needed again).
After connecting - ssh user@sshserver - executing of "powershell.exe" freezes the console (no input accepted) but running "powershell.exe /?" does return the console prompt correctly.
Q. how do I make powershell work over Cygwin SSH work?
P.S. freeSSHd was the only free SSH server on which PS scripts worked (console was accepting input requests from PS scripts and console would return to the command prompt). I wonder if freeSSHd is in some way based on OpenSSH or it is an independent product. It has other limitations though so I would like to use Cygwin/OpenSSH here.