Created
August 19, 2023 05:33
-
-
Save 641i130/cf89e2677ea23f28f4f814ef0192c491 to your computer and use it in GitHub Desktop.
Revisions
-
641i130 created this gist
Aug 19, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # 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`: ``` [DEFAULT] ignoreip = (public ip address of the private network its running on; the one you're tunneling out of) ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ [Unit] Description=SSH Port tunnel for minecraft After=network.target [Service] Type=simple User=mc Group=mc ExecStart=/usr/bin/ssh -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -n -N -R 12345:10.3.0.95:25565 [email protected] Restart=always RestartSec=20 KillMode=mixed [Install] WantedBy=multi-user.target This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Match User minecraft AllowTcpForwarding yes GatewayPorts yes