Reverse SSH dynamic port allotment error

Nimjox

When I run:

ssh -i mycert -R 0:localhost:80 [email protected]

and run the following on 'myserver.com':

curl localhost:dynamicly_assigned_port

I get 'ssh:Server send unrequested port, from port XXXX'. However running:

ssh -i mycert -R 20000:localhost:80 [email protected]

curl localhost:20000

Works fine. Any idea's why I get this error when using the dynamically allocated port but not when using a static port. My guess is its due to the old ssh version used in dropbear v0.52 but looking for any other ideas. Thanks

alienth

This error means that the server sent an unrequested forwarded port that the client didn't expect. In short, the dropbear SSH client doesn't know how to handle the dynamically allocated port forward which the remote server has allocated for it. It is unsupported by dropbear.

The relevant code:

Where the dropbear client parses the remote forward request and adds it to its tracked forward list: https://github.com/schemacs/dropbear/blob/3c4d57db86668f3cecd91566f971371fbea8684b/cli-runopts.c#L569

Where the dropbear client iterates through the remotefwds it requested and tries to find a match for the port forward which the server has setup: https://github.com/schemacs/dropbear/blob/3c4d57db86668f3cecd91566f971371fbea8684b/cli-tcpfwd.c#L214

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ssh dynamic port forwarding

why does dynamic allotment showing up critical error while no memory is being freed before the breakpoint achieved in visual studio

Stable reverse port forwarding in SSH and stale sessions

ssh through proxy via dynamic port forwarding

MacOS Dynamic Port Forwarding (ssh -D)

ssh dynamic port forwarding with remote (-g) is not working

Setting up port forwarding on router for reverse SSH tunnel

Doing an SSH reverse port forward without GatewayPorts enabled

Git ssh error: port 22: no route to host

Binding to Heroku dynamic $PORT and keep getting error?

How is SOCKS protocol used in SSH dynamic port forwarding?

How to create SSH dynamic forwarding through a port forwarding?

Configure NextCloud & Nginx Reverse Port Forward - Login Authentication Error

Trying to run rsync between two remote servers via reverse port forwarding with ssh key

Why can I not connect to a reverse SSH tunnel port remotely, even with GatewayPorts enabled?

ssh port forwarding does not work. Getting error

SSH port forwarding: "Privileged ports can only be forwarded by root" error

Error ssh: connect to host 333 port 22: Invalid argument

AWS Load Balancer Git Clone error over SSH Port

Reverse port tunnelling

Vagrant reverse port forwarding?

Reverse ssh tunnel in with .ssh/config

Is there a way to do dynamic socks-based port forwarding in Go, like the -d switch in SSH?

Can I turn an SSH dynamic port forward to a VPN to use for the whole system?

aws ec2 ssh error: `ssh: connect to host x port 22: Operation timed out`

`ssh: connect to host ssh.dev.azure.com port 22: Connection timed out` error

SSH Reverse socks tunnel

Reverse ssh tunnel in config

Reverse proxy with ssh