You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SftpClient hangs on Connect/ConnectAsync to atmoz/sftp server #1732
Happened on Fedora 42 (did not test on other OSs if matters), when I spin up atmoz/sftp docker image, and try to connect to it.
Connecting via Linux sftp -P <port> <user>:localhost to the same docker works perfectly fine.
In the atmoz/sftp logs, I see that the client actually authenticates:
[/entrypoint] Executing sshd
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
Accepted password for testuser from 172.17.0.1 port 50554 ssh2
However, it will not release Connect/ConnectAsync afterwards.
Configuring timeout in ConnectionInfo or for CancelationTokenSource, has not effect.
Using same SftpClient to connect to another locally spined SFTP, but using SFTP Go server, works fine.
Tried this with multiple SSH.NET versions, from latest back to mid 2024, same behavior.
changed the title [-]`SftpClient` hangs on `Connect/ConnectAsync` on connecting to `atmoz/sftp` server[/-][+]`SftpClient` hangs on `Connect/ConnectAsync` to `atmoz/sftp` server[/+]on Nov 5, 2025
It looks like neither ConnectionInfo.LoggerFactory, nor Renci.SshNet.SshNetLoggingConfiguration are part of the nuget 2025.1.0, although I can see them in develop branch.
That is odd, it means the library is not getting any reply to the SFTP init message. (BTW the library should timeout instead of hang by setting SftpClient.OperationTimeout)
Activity
[-]`SftpClient` hangs on `Connect/ConnectAsync` on connecting to `atmoz/sftp` server[/-][+]`SftpClient` hangs on `Connect/ConnectAsync` to `atmoz/sftp` server[/+]Rob-Hague commentedon Nov 5, 2025
I can't reproduce (on windows) - I can see the "upload" directory with e.g.
can you get a packet trace, and/or see where it is hanging in the library?
Rob-Hague commentedon Nov 5, 2025
Actually, a packet trace won't help much if it is getting past the authentication. Logging at trace level might: https://github.com/sshnet/SSH.NET/blob/develop/docfx/logging.md
TMS-Namespace commentedon Nov 6, 2025
It looks like neither
ConnectionInfo.LoggerFactory, norRenci.SshNet.SshNetLoggingConfigurationare part of the nuget2025.1.0, although I can see them indevelopbranch.Rob-Hague commentedon Nov 6, 2025
I can reference them both from a project using the nuget package. Check your imports etc?
TMS-Namespace commentedon Nov 6, 2025
Oh, apparently it was a Nuget cache issue, since I tried various versions...
Here are the logs:
and nothing after last line
the used code
Rob-Hague commentedon Nov 6, 2025
Could you please use
builder.SetMinimumLevel(LogLevel.Trace);instead of LogLevel.Debug?TMS-Namespace commentedon Nov 6, 2025
sorry just noticed that you asked for that from the beginning, thx for your follow up:
Rob-Hague commentedon Nov 6, 2025
That is odd, it means the library is not getting any reply to the SFTP init message. (BTW the library should timeout instead of hang by setting
SftpClient.OperationTimeout)I found atmoz/sftp#341 (comment) that seems to be relevant
mus65 commentedon Nov 8, 2025
FWIW, I can't reproduce this with Fedora 43 either.
But if this was the issue, I guess it shouldn't work with
sftpeither?Log with Fedora 43: