sshj icon indicating copy to clipboard operation
sshj copied to clipboard

Opening direct-tcpip channel failed. invalid originator port

Open sergioescudero opened this issue 6 years ago • 1 comments

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.

sergioescudero avatar Jan 24 '20 14:01 sergioescudero

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?

moritz31 avatar Jul 08 '20 06:07 moritz31