sshj
sshj copied to clipboard
Opening direct-tcpip channel failed. invalid originator port
Hi there,
one jump in my infra was updated to Openssh 8.
Since the upgrade, we are getting this error when we tried to upload a file:
[error] net.schmizz.concurrent.Promise <<chan#0 / open>> woke to: Opening `direct-tcpip` channel failed: open failed
Checking the jump log we have the following error:
error: server_request_direct_tcpip: invalid originator port
The line in OpenSSH that is throwing the error is
if (originator_port > 0xFFFF) {
error("%s: invalid originator port", __func__);
*reason = SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED;
goto out;
}
The port that is defined for creating the connection is https://github.com/hierynomus/sshj/blob/d10a33ec5906342571cdf03c225dd4b8d54e84e0/src/main/java/net/schmizz/sshj/connection/channel/direct/DirectConnection.java#L23
The port used is 65536.
Is there any way to use another port?
Thank you.
I face the same issue! @sergioescudero did you find a way around this issue? Seems like an easy fix to change the LOCALPORT to something accepted?