-
Notifications
You must be signed in to change notification settings - Fork 779
SSH client for Win10 hangs sometimes #1334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm having a similar issue. Executing When it does hang, it happens at syncio_close() (in contrib\win32\win32compat\termio.c) at line 263 (WaitForSingleObject):
Sometimes hitting Enter in terminal unblocks ssh.exe and it exits successfully. Also, if I run I have tried code from #1338 but it doesn't fix the issue. This seems like a different bug, probably closely related to #874 but it seems the issue is not confined to Win7 only. It happens on Win10 as well. |
@alexv1n can you try out patched binaries from @NoMoreFood in this thread - #1338 You would just need the updated version of ssh.exe. |
I did say that I tried that and it didn't help |
Seems this might be a low-level Windows issue, as I'm hitting something similar with kitty: cyd01/KiTTY#22 |
@Tyriar Can you please try the version 8.0 binaries (and verify using ssh -V that you're actually using version 8.0 binaries, as you did with 7.7). Thanks! |
@Tyriar, alright I'll try to take a look and see if I can repro it. What's the purpose of wrapping the execution in a command prompt? |
@NoMoreFood it might not make a difference but that's how we hit the bug initially |
FYI, I have been getting hangs on
I find that running with -vvv alone masks the problem. Logging to file with -E allows the hang again. I annotated the logs where they stopped at the time they hung. Now, this is about a 1-in-10 chance. I get different odds (more frequent) against an OpenSSH_7.9p1, OpenSSL 1.1.1b 26 Feb 2019 (Alpine 3.9) server. Windows 10 Enterprise 1709 16299.1217 Let me know if there's anything I should test out. |
I'm unsure if I'm hitting this issue or something else; when I try to ssh into my local Gitea server, the ssh command just hangs indefinitely. In my case, this does not appear to be intermittent. I'm also able to connect to the server using Putty, so the server itself is alive and responding on the expected port.
The Powershell terminal just sits there, unresponsive to Ctrl-C. Does this sound like the same issue or something else? I'm willing to dive a bit deeper with Wireshark or other tools if that would help. Version:
|
Since my previous comment, I found this post: I have confirmed that typing the following sequence terminates the ssh connection: Not sure what this means overall; I'm still unable to connect to my git server via SSH, but at least I'm able to close the terminal without having to hit 'X' on the window. |
I had this problem and tracked it down to some lines in my .bashrc file. I'm running Ubuntu 20.04:
|
I have the same problem when im trying to execute remote commands from a windows 2008 server. I have openssh 8.1p1 installed. It seems like command only shows output when i press enter. If i press enter and there is no output yet i have to press enter again. I think its an older Windows thing because when i tried it on Windows 10 or Linux it worked like it should have. And the ssh version i have installed on windows 10 is even lower (7.7p1) |
I have the same issue with Windows Server 2016 and Freesshd - RDP'ing into the server shows an error message 'powershell has stopped working' |
Same here (OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2) I'm using a scheduler sw (BMC Control-M) to run a bunch of jobs on different servers. I'm able to reproduce this when running multiple ssh's (10) at the same time. Currently I'm running a test with 10 sessions in parallel, restarting every 2 minutes. Just a simple ssh user@host uname -a got stuck from time to time, sometimes with output from the uname cmd, sometimes not. The sockets on both sides are still in state ESTABLISHED when this happens. I then changed the command to ssh -v user@host uname -a with different outputs ... debug1: Sending command: uname -a debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0 HANGS ... debug1: Sending command: uname -a Linux rt.xyz.de 4.14.35-1902.305.4.el7uek.x86_64 #2 SMP Tue Aug 4 14:17:05 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0 HANGS I changed sshd_config on the server side to ClientAliveInterval 10 ClientAliveCountMax 3 sshd detects the hanging client and disconnects it, but the client process itself doesn't terminate (as expected). When I change the command to ssh -vvv user@host uname -a it never hangs (as already mentioned by AHelper) BTW: |
I'm preparing to use plink. Why is it a pain? |
I never found an option similar to Yes, I know that this migth be an security issue, but I'm old enough to make my own decisions. plink explicitly needs parameters like -batch (Hey! Why do we have putty AND plink?) So for me, this is not the best tool to do things automagically in background. In ssh I have my %HOMEDRIVE%%HOMEPATH%.ssh\id_rsa and %HOMEDRIVE%%HOMEPATH%.ssh\config and everything is fine. BUT, when connecting interactively to sshd on Windows: |
My 2 cents, based on
and
all done to the same Linux host over a low latency (1ms) connection: Hangs almost always:
Hangs in 10% of cases:
Hangs in 4% (?) of cases when also writing to STDERR:
Hangs even less often (?) and does not add visible output:
Hanged once in 500 subsequent tries:
Using the last as a work-around in a wrapping powershell function. |
Workaround for ssh hangs sometimes when executing command remotely on Windows (PowerShell/Win32-OpenSSH#1334). It may hit an SSH rate limiter on the server-side network, which will block IP addresses that have too many ssh connection requests within a short period of time.
Disable X11 forwarding to workaround ssh hangs sometimes when executing command remotely on Windows (PowerShell/Win32-OpenSSH/issues/1334). It may hit an SSH rate limiter on the server-side network, which will block IP addresses that have too many ssh connection requests within a short period of time.
Disable X11 forwarding to workaround ssh hangs sometimes when executing command remotely on Windows (PowerShell/Win32-OpenSSH/issues/1334). It may hit an SSH rate limiter on the server-side network, which will block IP addresses that have too many ssh connection requests within a short period of time.
Same, confirmed with both the OpenSSH_for_Windows_8.1p1 native Win10 build and the latest OpenSSH_for_Windows_9.5p1 release. When executing a command such as below, around 20% of the time it doesn't return:
The remote command can be very simple and it still periodically hangs. It seems like the pause is for some kind of keyboard input even though nothing in the remote command would want it, since pressing enter resumes processing. But running ssh in this manner is likely commonly used unattended, so this workaround is not going to be viable in many cases. That said, I only use this form in attended scripts. |
Problem still exists :-( |
-- Monday, 30 September 2024, 11:46PM -05:00 from Peter-76 ***@***.*** :
…Problem still exists :-(
Any news on this more than 5 years old issue?
—
Reply to this email directly, view it on GitHub , or unsubscribe .
You are receiving this because you are subscribed to this thread. Message ID: @ github . com>
|
I have also experienced this issue on OpenSSH_for_Windows_9.5p1 on Win10 22H2 under the same conditions as described in threads above:
As a workaround (which seems to be working), I've added the StdinNull=yes option. |
Troubleshooting steps
https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting-Steps
Terminal issue? please go through wiki
https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH
Please answer the following
"OpenSSH for Windows" version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
Client OperatingSystem
Win10
What is failing
Sometimes SSH get hung when connecting to Ubuntu 16.04 64bit.
ssh -V
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
I got the debug trace with -vvv:
ssh.txt
Expected output
don't hang
Actual output
hang
The text was updated successfully, but these errors were encountered: