Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2023 05:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Minecraft SSH Port Tunnel

MC Port Tunnel SSH Service

Usecase -> not able to port forward in your network.

Assumptions: 12345 is the mc server's port that its opening on the remote server (25565). User mc is the user on the minecraft server. User minecraft is the user on the cloud SSH server.

If you have fail2ban installed, make sure to add the following to /etc/fail2ban/jail.local:

ignoreip = (public ip address of the private network its running on; the one you're tunneling out of)
Description=SSH Port tunnel for minecraft
ExecStart=/usr/bin/ssh -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -n -N -R 12345:
Match User minecraft
AllowTcpForwarding yes
GatewayPorts yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment