Closed havalli closed 5 years ago
Have you used -n option (https://linux.die.net/man/1/ssh)?
@havalli - Any update on this? can this be closed?
Please reopen if required.
@bagajjal - I teste with -n option. Still same error. How do i reopen this issue?
Hello, I am experiencing same issue when using -n option with OpenSSH Client version v0.0.21 and OpenSSH Server version v0.0.20 (both on Windows 2012 servers). The error is raised after ssh client times out (5 minutes in my tests).
It would be great if you can provide the detailed reproduction steps. Please share the ssh client (ssh -vvv user@ip) and sshd (DEBUG3) logs.
The ssh command is initiated from CHEF client, I will try to grab the client output with -vvv. Meanwhile I was able to collect the DEBUG3 logs on server side.
11476 15:38:13:105 debug3: socket:356, io:0000001F2FA85CE0, fd:5
11476 15:38:13:105 debug3: fd 5 is not O_NONBLOCK
11476 15:38:13:105 debug3: pipe - r-h:336,io:0000001F2FA85D90,fd:6 w-h:396,io:0000001F2FA78470,fd:7
11476 15:38:13:105 debug3: spawning "C:\Program Files\OpenSSH\sshd.exe"
11476 15:38:13:105 debug3: Register child 000000000000013C pid 9132, 0 zombies of 0
11476 15:38:13:105 debug3: close - io:0000001F2FA85CE0, type:1, fd:5, table_index:5
11476 15:38:13:105 debug1: Forked child 9132.
11476 15:38:13:105 debug3: close - io:0000001F2FA78470, type:2, fd:7, table_index:7
9132 15:38:13:120 debug1: sshd version OpenSSH_7.5, LibreSSL 2.5.3
9132 15:38:13:120 debug3: socket:0, socktype:1, io:000000347A65FC20, fd:3
9132 15:38:13:120 debug3: close - io:000000347A65FC20, type:2, fd:3, table_index:3
9132 15:38:13:120 debug3: open - handle:00000000000000F0, io:000000347A660750, fd:3
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: close - io:000000347A660750, type:2, fd:3, table_index:3
9132 15:38:13:120 debug1: private host key #0: ssh-rsa SHA256:l/79rJLA22Ufg3r3REYmNcnoPG3t/oFsATfvSDYNDpQ
9132 15:38:13:120 debug3: open - handle:00000000000000F0, io:000000347A660750, fd:3
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: close - io:000000347A660750, type:2, fd:3, table_index:3
9132 15:38:13:120 debug1: private host key #1: ssh-dss SHA256:hgueF2cofwkLFpfxgfqhfPLkDvYV600H26rzUflBpcI
9132 15:38:13:120 debug3: open - handle:00000000000000F0, io:000000347A660750, fd:3
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: close - io:000000347A660750, type:2, fd:3, table_index:3
9132 15:38:13:120 debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:ihIIAATwL+ZaE9iRPDr0NvQguyPuXnqBfKAyAUQ3wmc
9132 15:38:13:120 debug3: open - handle:00000000000000F0, io:000000347A660750, fd:3
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: ReadFileEx() ERROR:38, io:000000347A660750
9132 15:38:13:120 debug3: read - no more data, io:000000347A660750
9132 15:38:13:120 debug3: close - io:000000347A660750, type:2, fd:3, table_index:3
9132 15:38:13:120 debug1: private host key #3: ssh-ed25519 SHA256:OJRDcYTRtNk98QuhZPP37yZT9lBVtHXXUQNNmPTeVmY
9132 15:38:13:136 debug1: child socket: 356
9132 15:38:13:136 debug1: child startup_pipe: 396
9132 15:38:13:136 Connection from 10.0.168.48 port 51524 on 10.0.10.37 port 22
9132 15:38:13:136 debug1: Client protocol version 2.0; client software version OpenSSH_7.5
9132 15:38:13:136 debug1: match: OpenSSH_7.5 pat OpenSSH* compat 0x04000000
9132 15:38:13:136 debug1: Local version string SSH-2.0-OpenSSH_7.5
9132 15:38:13:136 debug2: fd 3 setting O_NONBLOCK
9132 15:38:13:136 debug3: socket:0, socktype:1, io:000000347A6622A0, fd:5
9132 15:38:13:136 debug3: list_hostkey_types: ssh-dss key not permitted by HostkeyAlgorithms
9132 15:38:13:136 debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
9132 15:38:13:136 debug3: send packet: type 20
9132 15:38:13:136 debug1: SSH2_MSG_KEXINIT sent
9132 15:38:13:136 debug3: receive packet: type 20
9132 15:38:13:136 debug1: SSH2_MSG_KEXINIT received
9132 15:38:13:136 debug2: local server KEXINIT proposal
9132 15:38:13:136 debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
9132 15:38:13:136 debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
9132 15:38:13:136 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
9132 15:38:13:136 debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
9132 15:38:13:136 debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
9132 15:38:13:136 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
9132 15:38:13:136 debug2: compression ctos: none
9132 15:38:13:136 debug2: compression stoc: none
9132 15:38:13:136 debug2: languages ctos:
9132 15:38:13:136 debug2: languages stoc:
9132 15:38:13:136 debug2: first_kex_follows 0
9132 15:38:13:136 debug2: reserved 0
9132 15:38:13:136 debug2: peer client KEXINIT proposal
9132 15:38:13:136 debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
9132 15:38:13:136 debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
9132 15:38:13:136 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
9132 15:38:13:136 debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
9132 15:38:13:136 debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
9132 15:38:13:136 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
9132 15:38:13:136 debug2: compression ctos: none
9132 15:38:13:136 debug2: compression stoc: none
9132 15:38:13:136 debug2: languages ctos:
9132 15:38:13:136 debug2: languages stoc:
9132 15:38:13:136 debug2: first_kex_follows 0
9132 15:38:13:136 debug2: reserved 0
9132 15:38:13:136 debug1: kex: algorithm: curve25519-sha256
9132 15:38:13:136 debug1: kex: host key algorithm: ecdsa-sha2-nistp256
9132 15:38:13:136 debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC:
@nellfr - Please let us know how to reproduce this issue..
From the Windows system, the CHEF client is issuing this command : cmd /c "C:\PROGRA~1\OpenSSH-Win64\ssh.exe -vvv -n -o StrictHostKeyChecking=no -i C:\key_path\id_rsa user@10.0.168.48 powershell.exe -File C:\script_path\script_wrapper.ps1 param1 param2 param3 > C:\ssh_output.txt 2>&1"
Hello, were you able to reproduce this issue? I can provide additional information or logs whenever needed.
Same problem, -n does not help
You can help to solve the problem, since you need to deploy projects to the Windows server using ssh?
@bagajjal
@nellfr - I tried the command you gave me but couldn't reproduce "GetConsoleMode on STD_INPUT_HANDLE failed with 6".
@bagajjal @havalli @nellfr Can there be a problem in Gitlab? I wrote C # code that executes ssh and it normally works.
@bagajjal , I am executing the ssh command with "-n" can you try with that parameter please? Also I observed that the "GetConsoleMode on STD_INPUT_HANDLE failed with 6" is raised after my target script (script_wrapper.ps1 on SSH server) runs during several minutes. I would suggest to sleep your script "getdate.ps1" for 5 minutes.
hello @rjpackito , I'm not sure to understand the problem you are facing with ssh. Do you observe "GetConsoleMode on STD_INPUT_HANDLE failed with 6" message while running an ssh command ?
@nellfr Yes, I see the same error during the execution of the script on Gitlab Runner CI/CD . I can not understand what the problem is. Because the SCP command works fine. I really need the SSH to deploy on my remote machine my dotnet core application
@nellfr - adding "-n", sleep of 5 minutes works perfectly... I didn't see any issue.
@rjpackito - This is a ssh client side issue. You can try other ssh clients (putty/Cygwin) if you are blocked. Unfortunately I couldn't reproduce this issue. It would be great if you can provide reproduction steps.
@bagajjal that is, you can not fix the problem in OpenSSH? Can you install the Gitlab Runner?
Have you tried other ssh clients? If it works in putty then we can fix in openssh... Right now I can't repro the issue.. I will try the gitlab runner.. Meanwhile try using different ssh client like putty
@bagajjal I do not know, can putty do xcopy through cmd?
I didn't understand your question.. All the ssh commands get executed on the server side.. ssh client will not execute any command..
@bagajjal Hey. I used plink.exe and it works in gitlab-runner.
Please reopen if required.
I am facing the same issue. Tried almost everything -n etc. It is getting stuck at ssh. scp is working fine.
Try using -T (no-pty) in ssh.exe.
Still the same. ssh is not closing the connection. Therefore it is stuck.
can you share the ssh client logs (ssh.exe -vvv user@ip) and sshd.log (DEBUG3 enabled) server side logs
Encountered this problem myself. It happens when you run SSH as a child process via CreateProcess and stdhandles are being redirected.
I executed this command as an example: ssh -n -T user@server ls
The return code signals, the command was successful, the output to stdout is like you would expect it, but you get output to stderr.
If you put a binary zero into the hStdInput of STARTUPINFO, you will get the following output on StdError: GetConsoleMode on STD_INPUT_HANDLE failed with 6 fcntl(-2, F_GETFL): Bad file descriptor
If you put a handle to a file or /dev/null into the hStdInput of STARTUPINFO, you will get only GetConsoleMode on STD_INPUT_HANDLE failed with 6
It seems that with the option "-T" some code still tries to get the console capabilities using GetConsoleMode, which fails on file handles and triggers this error being written to stderr.
https://serverfault.com/questions/593399/what-is-the-benefit-of-not-allocating-a-terminal-in-ssh
https://docs.microsoft.com/en-us/windows/console/getconsolemode
Hope this helps to fix the problem.
@anrose00 can you share a snippet of your code doing CreateProcess(ssh) with io redirection ?
Created a simple wrapper that simply passes the first argument to CreateProcess. This way you can write in a shell "sshwrap "ssh -n -T user@server cmd". You will find two files in temp directory: ssh-stdout, ssh-stderr.
#include <windows.h>
#include <TCHAR.h>
HANDLE GetFileHandleForRedirection(LPTSTR sName, BOOL bTmp, INT iRwMode)
{
TCHAR sFnBuffer[MAX_PATH];
SECURITY_ATTRIBUTES stSecAttr;
HANDLE hFile;
if (bTmp)
{
GetTempPath(MAX_PATH,sFnBuffer);
strcat(sFnBuffer,sName);
}
else
{
strcpy(sFnBuffer,sName);
}
memset(&stSecAttr,0,sizeof(SECURITY_ATTRIBUTES));
stSecAttr.nLength=sizeof(SECURITY_ATTRIBUTES);
stSecAttr.bInheritHandle=TRUE;
hFile = CreateFile(sFnBuffer,iRwMode,0,&stSecAttr,OPEN_ALWAYS,0,NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
return NULL;
}
SetFilePointer(hFile,0,NULL,FILE_END);
return hFile;
}
BOOL SShExecute(LPTSTR path, BOOL wait, BOOL hidden, LPDWORD lastError, LPDWORD returnCode)
{
STARTUPINFOA startUpInfo;
PROCESS_INFORMATION pInfo;
BOOL res;
HANDLE hStdIn,hStdOut,hStdErr;
memset(&startUpInfo,0, sizeof(startUpInfo));
startUpInfo.cb = sizeof(startUpInfo);
if (hidden)
{
startUpInfo.wShowWindow = 0;
startUpInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES | STARTF_USESIZE;
startUpInfo.dwXSize = 0;
startUpInfo.dwYSize = 0;
hStdIn = GetFileHandleForRedirection("nul", FALSE, GENERIC_READ );
if (hStdIn)
startUpInfo.hStdInput = hStdIn;
hStdOut = GetFileHandleForRedirection("ssh-stdout", TRUE, GENERIC_WRITE );
if (hStdOut)
startUpInfo.hStdOutput = hStdOut;
hStdErr = GetFileHandleForRedirection("ssh-stderr", TRUE, GENERIC_WRITE );
if (hStdErr)
startUpInfo.hStdError = hStdErr;
}
res = CreateProcess(NULL,path,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS,NULL,NULL,&startUpInfo,&pInfo);
if (res && wait) {
WaitForSingleObject( pInfo.hProcess, INFINITE );
}
if (hStdIn) CloseHandle(hStdIn);
if (hStdOut) CloseHandle(hStdOut);
if (hStdErr) CloseHandle(hStdErr);
if (res) {
GetExitCodeProcess(pInfo.hProcess,returnCode);
CloseHandle( pInfo.hProcess );
CloseHandle( pInfo.hThread );
}
else {
*lastError = GetLastError();
}
return res;
}
int _tmain(int argc, TCHAR *argv[])
{
DWORD dwLastError,dwReturnCode=0;
if (argc == 2)
{
SShExecute(argv[1], TRUE, TRUE, &dwLastError, &dwReturnCode);
}
return dwReturnCode;
}
Issue ist still present in Release 7.9.0.0 - please reopen.
Looked into this. It seems that GetFileType on hStdIn (that's pointing to a nul device) is returning FILE_TYPE_CHAR - that's making ssh.exe think that its a console handle, but when the actual console IO is preformed on this handle, it fails resulting in that log. We'll need to investigate if this behavior is by design and accommodate if necessary.
To unblock, you could use a pipe handle (from CreatePipe()) for hStdIn whose other end of the pipe is closed.
Quoting from the ssh man pages regarding the "-n" option:
-n' Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background.
Perhaps it's possible to make console IO for stdin dependent on this option?
I changed the minimal example to give the proposal with pipes a try.
#include <windows.h>
#include <TCHAR.h>
HANDLE GetFileHandleForRedirection(LPTSTR sName, BOOL bTmp, INT iRwMode)
{
TCHAR sFnBuffer[MAX_PATH];
SECURITY_ATTRIBUTES stSecAttr;
HANDLE hFile;
if (bTmp)
{
GetTempPath(MAX_PATH,sFnBuffer);
strcat(sFnBuffer,sName);
}
else
{
strcpy(sFnBuffer,sName);
}
memset(&stSecAttr,0,sizeof(SECURITY_ATTRIBUTES));
stSecAttr.nLength=sizeof(SECURITY_ATTRIBUTES);
stSecAttr.bInheritHandle=TRUE;
hFile = CreateFile(sFnBuffer,iRwMode,0,&stSecAttr,OPEN_ALWAYS,0,NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
return NULL;
}
SetFilePointer(hFile,0,NULL,FILE_END);
return hFile;
}
HANDLE GetReadHandleForRedirection()
{
SECURITY_ATTRIBUTES stSecAttr;
HANDLE hPipeRead, hPipeWrite;
BOOL bRes;
memset(&stSecAttr,0,sizeof(SECURITY_ATTRIBUTES));
stSecAttr.nLength=sizeof(SECURITY_ATTRIBUTES);
stSecAttr.bInheritHandle=TRUE;
bRes = CreatePipe(&hPipeRead,&hPipeWrite,&stSecAttr,0);
if (!bRes)
return NULL;
CloseHandle(hPipeWrite);
return hPipeRead;
}
BOOL SShExecute(LPTSTR path, BOOL wait, BOOL hidden, LPDWORD lastError, LPDWORD returnCode)
{
STARTUPINFOA startUpInfo;
PROCESS_INFORMATION pInfo;
BOOL res;
HANDLE hStdIn,hStdOut,hStdErr;
memset(&startUpInfo,0, sizeof(startUpInfo));
memset(&pInfo,0, sizeof(pInfo));
startUpInfo.cb = sizeof(startUpInfo);
if (hidden)
{
startUpInfo.wShowWindow = 0;
startUpInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES | STARTF_USESIZE;
startUpInfo.dwXSize = 0;
startUpInfo.dwYSize = 0;
hStdIn = GetReadHandleForRedirection();
// printf("FileType stdin: %i\r\n",GetFileType(hStdIn));
if (hStdIn)
startUpInfo.hStdInput = hStdIn;
hStdOut = GetFileHandleForRedirection("ssh-stdout.txt", TRUE, GENERIC_WRITE );
if (hStdOut)
startUpInfo.hStdOutput = hStdOut;
hStdErr = GetFileHandleForRedirection("ssh-stderr.txt", TRUE, GENERIC_WRITE );
if (hStdErr)
startUpInfo.hStdError = hStdErr;
}
res = CreateProcess(NULL,path,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS,NULL,NULL,&startUpInfo,&pInfo);
if (res && wait) {
WaitForSingleObject( pInfo.hProcess, INFINITE );
}
if (hStdIn) CloseHandle(hStdIn);
if (hStdOut) CloseHandle(hStdOut);
if (hStdErr) CloseHandle(hStdErr);
if (res) {
GetExitCodeProcess(pInfo.hProcess,returnCode);
CloseHandle( pInfo.hProcess );
CloseHandle( pInfo.hThread );
}
else {
*lastError = GetLastError();
}
return res;
}
int _tmain(int argc, TCHAR *argv[])
{
DWORD dwLastError,dwReturnCode=0;
if (argc == 2)
{
SShExecute(argv[1], TRUE, TRUE, &dwLastError, &dwReturnCode);
}
return dwReturnCode;
}
This seems to work for Windows 7 systems, but not for Windows 10. On Windows 10 I'm still getting the "GetConsoleMode on STD_INPUT_HANDLE failed with 6" although the file type for STD_INPUT_HANDLE is now "FILE_TYPE_PIPE". So either the error message is wrong here, or SSH is using ConsoleAPI for pipe handles. I've detected another more critical issue with Win10, but I will open an extra issue for this.
I tried your code on a Windows 10 box and it works fine. I also tried startUpInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); with "ssh -n" and that worked fine too.
I get the same error within a ci job with gitlab runner, executed manually:
PS F:\> $TARGET_DEPLOY_DIR="ssh target mktemp -d"
PS F:\> echo $TARGET_DEPLOY_DIR
/tmp/tmp.uv3oMZ
when executed in the pipeline:
Running with gitlab-runner 11.9.1 (de08a4bb)
on runner
Using Shell executor...
Running on host...
Fetching changes...
Clean repository
From url
79f1b1b..50641bc master -> origin/master
Checking out 50641bc8 as master...
git-lfs/2.7.1 (GitHub; windows amd64; go 1.11.5; git 6b7fb6e3)
Skipping Git submodules setup
$ $TARGET_DEPLOY_DIR=ssh target mktemp -d
GetConsoleMode on STD_INPUT_HANDLE failed with 6
No difference when I add the -n
or -T
switches
Hi All, I met the same problem. And I have downloaded OpenSSH 8 (https://www.mls-software.com/opensshd.html). The problem has been fixed. Without any option(-T or -n) and never see "GetConsoleMode on STD_INPUT_HANDLE failed with 6" again. Thanks for you all. Hope it can help others.
I installed OpenSSH 8, used -n option, add 5 minutes timeout, switched to git ssh, still stuck at "GetConsoleMode on STD_INPUT_HANDLE failed with 6" and the job will hung for long time.
Related to #1330 ?
Related to #1330 ?
If you are doing these in Windows, there's this file permission issue, that you need to disable inheritance then add the current user in the permission of the ssh config file. After that I think I got that problem solved. Somehow if your computer name is the same as user name, it also has problem.
Just to throw another data point out there, I'm having this issue with OpenSSH 7.9p1 - getting the 'STD_INPUT_HANDLE failed with 6' issue from a Jenkins runner. It executes the remote command I ask it to, but hangs forever. If I run the same command, same user, from outside of Jenkins, there are no issues. I have not been able to try with 8.x yet.
If I add -vvv to ssh, it appears to be hanging during the cleanup of the socket.
@rcarmich - For interactive ssh session we need to get the stdin handle. Are you trying to get interactive ssh session inside jenkins runner? If not then try non-pty session (ssh -T user@ip).
@bagajjal Yeah, have tried -T without success. Also making things more complicated, the same ssh command works inside the Jenkins runner in a development environment but not on our production Jenkins setup - same Jenkins version, same OpenSSH version, etc. Very bizarre.
I'm having the same issue as well. I'm using circle ci to deploy my .Net Core console app to a windows server (a bare-metal server) With circle ci 2.1, I'm using windows orb version 2.4.1. I tried to use all the available shell, cmd, powershell and bash and still no luck (Here's the list of all pre installed software on the orb https://circleci.com/docs/2.0/hello-world-windows/#software-pre-installed-in-the-windows-image ). The ssh connection is getting stuck.
Please answer the following
"OpenSSH for Windows" version 0.0.18.0
Server OperatingSystem 0.0.18.0
Server 2016 Core
What is failing ssh user@server remoteComand
Expected output no Error
Actual output GetConsoleMode on STD_INPUT_HANDLE failed with 6
The command is executed in a CI/CD Pipeline by a gitlab-runner. If I execute the command manually inside a cmd window there is no error. The error don't occure with previous version 0.0.17.0.