My setup is this:

  • My computer has a Minecraft server running on it, listening to port 25565. It is protected by a firewall, so can not be accessed externally (and I have no control over port forwarding)
  • I have a server that is publicly accessible.

I want to make it so that the server forwards all requests on port 25565 to my computer, via an (ssh) tunnel.

I tried using ssh command on my computer to create a reverse tunnel, however that doesn't seem to work:

ssh -R 25565:localhost:25565 user@myserver

You must enable GatewayPorts in the server sshd config in order for remote port forwarding to work. Depending on what it's set to you may need to specify the bind address when using the -R option, otherwise the tunnel will only accept connections from localhost. e.g ssh -R *:25565:localhost:25565 user@myserver.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.