SSH tunneling or VPN to host a game server on my computer

I want to have a minecraft server on my computer but I can't open ports on my local network, my ISP doesn't allow it.

I have a VPS in hand and I wonder like what if I open ports on my VPS and host my own VPN server on my VPS and connect to it, then run the game server on my computer. Would this work?

Also, I heard that I could use SSH tunneling too. Would it work in this case?

1 Answer

You can try this command:

 ssh -R *:25565:127.0.0.1:25565 <USER>@<VPS IP>

It will forward your local minecraft server 127.0.0.1:25565 (replace this address and port according to your situation) to remote *:25565 (* indicates that the port should be available from all interfaces).

But before that, please confirm to add GatewayPorts yes option to /etc/sshd/sshd_config file on your VPS.

By default, sshd binds remote port forwardings to the loopback address. This prevents other remote hosts from connecting to forwarded ports. GatewayPorts can be used to specify that sshd should allow remote port forwardings to bind to non-loopback addresses, thus allowing other hosts to connect.

Then, you can connect to your minecraft server on <VPS IP>:25565.

Or you can try other tunneling tools, such as ngrok, frp.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like