I have a device on a remote host which connects via IP address (see image below). For this example, my remote host is named myremote, and the device is visible on myremote as, port 55555.

I would like to connect to this device on my local machine (localhost) such that I can access the device directly in the same way. I've tried connecting with ssh to map the port, but I cannot reach the device.

How can I setup the ssh tunnel such that I request connection to the device ( and can access it on my local machine? I've tried using ssh tunnel but haven't had much success:

# executed from command line on localhost
ssh -vvv -N -T -L :55555: username@myremote

I need to connect from localhost to the device at, which is visible only on the remote host. I can connect fine with ssh, and can make other tunnel operations work (jupyter notebook remote server, for instance). However, I cannot so far reach the device itself. Note: the device is connected locally to the remote using an ethernet cable, and cannot be seen on the remotehost's LAN.

enter image description here.

1 Answer 1


I run successfully this command:

ssh -vvv -N -T -L 55555: username@myremote

maybe you provide us with the output from ssh, when it wont work.

On my connection I get:

Authenticated to myremote ([XXX.XXX.XXX.XXX]:22).
debug1: Local connections to LOCALHOST:55555 forwarded to remote address

It can also be, that forwarding is not allowed on the remote ssh host.

Check this on the myremote host for a openssh-server:

grep AllowTcpForwarding /etc/ssh/sshd_config

or the params -a, -j and -k for dropbear

Also keep in mind, that you forward a TCP port - not UDP

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .