-
Notifications
You must be signed in to change notification settings - Fork 783
ssh server randomly crashing when using sftp. #778
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
Enable the logs in the sshd_config Subsystem sftp sftp-server.exe -l DEBUG3 While running sftp client, use -vvv flags ( .\sftp.exe -vvv user@IP) so that it dumps the logs onto the console. Please share sshd.log, sftp-server.log and ssh log file. I would suggest to do it manually (instead of running the script), since the probability of reproducing this is very high (50:50).. |
So in an interesting development, if I enable debugging for the sftp-server, I can't reproduce the issue and I tried 10-15 times. As soon as I turn it off I could reproduce it again. Here is the debug output from the client running sftp.exe when the issue happens: C:\Users\chris.TSNET\Documents\OpenSSH-Win32>.\sftp.exe -vvv [email protected] C:\Users\chris.TSNET\Documents\OpenSSH-Win32> I've attached the logs from the ssh-agent, sshd and sftp-server. They include when I tested this with debug enabled but without the issue occuring incase anything of interest is there. I'll leave debug enabled in the server so if this does reproduce then we'll have the required logging running. |
Any update? Few observations..
error: Couldn't create pid file "./sshd.pid": Permission denied
|
So I've retested with the fixed pid file and it makes no difference. I've also retested with debug running on the ssh server, but not on the SFTP-server to see what effect that had. I could then see the issue reproducing and in the sshd logs I could see additional debug output. I've attached the sshd log which does cover the issue reproducing to hopefully help with this. To help with completeness, I'm not running the ssh server on a machine in a domain. I've confirmed both the agent and server are running, to rule that out from causing this. |
Couldn't get much information from logs as the connection close triggered from the client side... To make progress we need the client side logs (ssh.exe -vvv user@ip and sftp.exe -vvv user@IP),
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-5I8G2O/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(c
5340 12:06:11 191 debug1: Executing command: C:\Program Files\OpenSSH\ssh-shellhost.exe -nopty VEFTS0xJU1Q= |
I've reproduced this again with the sftp client bundled in with the server. The client logs when hitting this issue are: C:\Users\chris.TSNET\Downloads\OpenSSH-Win32\OpenSSH-Win32>sftp.exe -vvv [email protected] C:\Users\chris.TSNET\Downloads\OpenSSH-Win32\OpenSSH-Win32> I've attached the sshd.log The end of the ssh-agent log shows the following (I can't confirm timings, as the log times don't match the client time for some reason, perhaps they're for another day)... 5260 12:06:03 488 agent_process_connection pipe:00000178 I'm going to re-test this now, with Debug enabled on the SFTP server but not on the SSH server to see if I can reproduce the issue like that. |
Ok, everything works fine, I can't reproduce with the SFTP debug enabled. debug2: fd 3 setting TCP_NODELAY I think I've spotted another bug, when the SFTP client is connected, if I exit, then the I see OpenSSH for Windows has stopped responding, and then program crashes. sftp> exit debug3: close - io:002063F8, type:3, fd:6, table_index:6 C:\Users\chris.TSNET\Downloads\OpenSSH-Win32\OpenSSH-Win32> |
Turning on the debug fixed the problem for me as well |
I'm using the sftpclient in paramiko to connect to the server to put files and list directories etc. I'm finding on both my Windows 7 server and Windows 10 server (machines running the SSH server) that paramiko is reporting the connection has been force closed at random times. It seems to be 50:50 as to if I see the connection force closed, or it connects successfully. When I look on the Windows 7 server, I see a pop up stating that openSSH has crashed and the options to send the crash report to Microsoft. I annoyingly clicked the option in the crash report to automatically send the reports, so I now no longer get the crash pop up when this occurs, so I can't provide any additional information.
I've checked the sftp-server log and it's empty, so no clues there as to what's happening. The fact this happens on multiple machines makes me believe this isn't something specific to a single OS.
Please answer the following
"OpenSSH for Windows" version
Latestversion: v0.0.16.0
Server OperatingSystem
Windows 7 Enterprise
Windows 10
For added benefit, the python script which hits this looks similar to below.
import paramiko,
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ip, username=, password=)
sftp_con = client.open_sftp() << Here is where the connection is force closed.
Sorry I can't provide any additional debug then this currently. I'm happy to re-run the test which produces this with any additional debug options set if someone lets me know.
The text was updated successfully, but these errors were encountered: