Restricting port forwarding on remote server

Dale Worley dale.worley at oracle.com
Wed Jan 3 02:59:45 AEDT 2018


On 1/2/18 10:24 AM, Juanito wrote:
> In my example, where I didn't express myself very clearly, I meant port
> to be 10000. The idea would be for port 10000 on the server to redirect
> to port 22 (ssh) on the device I wish to reach.

You need to be clearer about the names of the machines involved.  I 
assume that your initial ssh is from "the client" to "the server".  You 
want all attempts to connect to port 10000 on the server to be forwarded 
to port 22 on "the device you wish to reach", which is a third host.

> So I could do something like:
>
> ssh -p 10000 user at server
>
> to connect to port 22 on the device.

This is straightforward:  If you use the arguments "-R 10000:device:22", 
then any attempt to connect to port 10000 on the server will be 
transported back to the client, from which it will be an outgoing TCP 
connection to port 22 on "device".

Dale



More information about the openssh-unix-dev mailing list