hierynomus / hierynomus/sshj

Upload to OpenSSH on Windows 2019 hangs

Open
#536 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.7k
Forks
620
Avg merge
3d 23h
Merged PRs (30d)
11

Description

Trying to run the Upload example against the following OpenSSH on Windows2019:
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

Just to keep it simple I have only changed to use PromiscuousVerifier, and using basic auth (setAuthPassword). Also get the same problem running on the Windows box itself and accessing via the hostname or localhost just to make sure it is not a firewall issue.

As far as I can tell the code attempts to send a message to initiate upload but does not receive an ACK in return as expected. The DEBUG logs always end in "Consuming by 19 down to 2097106 and then code freezes". I would lean toward this being a problem in the windows version of OpenSSH server, but I can scp files to the service using command-line scp without issue.

Code:
```
public class SCPUpload {
public static void main(String[] args)
throws IOException {
SSHClient ssh = new SSHClient();
ssh.addHostKeyVerifier(new PromiscuousVerifier());
ssh.connect(args[0]);
try {
ssh.authPassword(args[1], args[2]);
final String src = System.getProperty("user.home") + File.separator + "test_file";
ssh.newSCPFileTransfer().upload(new FileSystemFile(src), "C:\\" + File.separator);
} finally {
ssh.disconnect();
}
}
}
```

Logs:

```
[DEBUG] transport.KeyExchanger: Trying to verify host key with net.schmizz.sshj.transport.verification.PromiscuousVerifier@515a0e2e
[DEBUG] transport.KeyExchanger: Sending SSH_MSG_NEWKEYS
[DEBUG] transport.KeyExchanger: Received SSH_MSG_NEWKEYS
[DEBUG] concurrent.Promise: Setting <> to `null`
[DEBUG] concurrent.Promise: Setting <> to `SOME`
[DEBUG] sshj.SSHClient: Key exchange took 0.182 seconds
[DEBUG] connection.ConnectionImpl: Attaching `session` channel (#0)
[DEBUG] concurrent.Promise: Awaiting <>
[DEBUG] direct.SessionChannel: Initialized - < session channel: id=0, recipient=0, localWin=[winSize=2097152], remoteWin=[winSize=0] >
[DEBUG] concurrent.Promise: Setting <> to `SOME`
[DEBUG] direct.SessionChannel: Will request to exec `scp -t -r -p '/tmp/'`
[DEBUG] direct.SessionChannel: Sending channel request for `exec`
[DEBUG] concurrent.Promise: Awaiting <>
[DEBUG] direct.SessionChannel: Received window adjustment for 2097152 bytes
[DEBUG] channel.Window$Remote: Increasing by 2097152 up to 2097152
[DEBUG] concurrent.Promise: Setting <> to `SOME`
[DEBUG] channel.Window$Local: Consuming by 1 down to 2097151
[DEBUG] scp.SCPEngine: Start status OK
[DEBUG] xfer.LoggingTransferListener: started transferring file `test_file` (21 bytes)
[DEBUG] scp.SCPEngine: Sending message: T1569265656 0 1569265662 0
[DEBUG] channel.Window$Remote: Consuming by 27 down to 2097125
[DEBUG] channel.Window$Local: Consuming by 1 down to 2097150
[DEBUG] scp.SCPEngine: Message ACK received
[DEBUG] scp.SCPEngine: Sending message: C0644 21 test_file
[DEBUG] channel.Window$Remote: Consuming by 19 down to 2097106
```

... hangs

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.