How to tunnel port 25565 through SSH?

20,692

Solution 1

The simplest way is to use putty (Client Side APP). You should not need anything on the remote side except firewall rules to allow out going connections

Setup:

  1. Within putty setup a new connection to your unix box.(Add the host details etc , don't connect yet)
  2. Once that is all setup go to Connection -> SSH -> Tunnels in the putty tree view.
  3. Next enter 25565 into the source port and leave the destination blank.
  4. Finally select dynamic on the first combo box.
  5. Make sure you save everything then finally click the open button

This will create a tunnel on port 25565 locally to any destination on the remote site. This also assumes that you can tunnel a minecraft connection (you might need to set your IE settings to use the the SSH tunnel as well since games sometimes use this if they cant get a connection)

If you cant tunnel minecraft by default use a app like proxy cap to force all out going connections through the tunnel.

Solution 2

I have drawn some sketches

For making it easier to understand the tunnel mechanisms, watch these sketches. The machine, where the ssh tunnel command is typed is called »your host«.

ssh tunnel starting from local


ssh tunnel starting from remote

Introduction

  1. local: -L Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side.

    ssh -L sourcePort:forwardToHost:onPort connectToHost means: connect with ssh to connectToHost, and forward all connection attempts to the local sourcePort to port onPort on the machine called forwardToHost, which can be reached from the connectToHost machine.

  2. remote: -R Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side.

    ssh -R sourcePort:forwardToHost:onPort connectToHost means: connect with ssh to connectToHost, and forward all connection attempts to the remote sourcePort to port onPort on the machine called forwardToHost, which can be reached from your local machine.

Your example

The second image represents your scenario. The remotehost is your dedicated server running linux not too far from uni. The farawayhost is the blocked minecraft server you want to connect to on its pink port 25565.

 ssh -L 12345:minecraftServerIP:25565 dedicatedServer

The port number of the green port is 12345. You can now access the minecraft server by connecting to

localhost:12345

Of course you can change the green port’s number 12345 to whatever you want.

Solution 3

Simple, run the command

ssh -L 25565:minecraftserverIp:25565 user@remotelinuxbox

Then add a server to your minecraft client localhost:25565

This will allow you to connect to the remote minecraft server via the ssh tunnel.

Solution 4

Try http-tunnel. Just go to Settings>Add Ports/Applications and enter the server IP and application port (usually 25565) then press ok and try running minecraft.

Share:
20,692

Related videos on Youtube

Matt
Author by

Matt

SOreadytohelp

Updated on September 17, 2022

Comments

  • Matt
    Matt over 1 year

    I want to play a game which is hosted on port 25565 (minecraft!), but my university firewall does not allow this port.

    I have a dedicated server running linux not too far from uni, so I think there's a way to tunnel through it (but I've never done this before and have no knowledge/experience of tunnelling)

    It would probably be slow, but it's better than not being able to play at all. Is it possible to do using only SSH, or do I need other client/server software? My server has OpenSSH installed. Also, the computer I'm using to play the game is running Ubuntu.

    I've tried searching but there seem to be so many different solutions to different types of problem =/

  • Matt
    Matt over 13 years
    Minecraft doesn't let me choose a proxy, it just connects directly. I found out how to set up a proxy and set it to apply systemwide and it works for firefox etc, but minecraft just ignores it. Do you mean Internet Explorer by IE? If so, I'm on linux :)
  • RC1140
    RC1140 over 13 years
    Sorry I assumed that you were using windows , But linux has the same option (well at least ubuntu does). If you go to System -> Preferences -> Network Proxy , you should be able to route all or most of the traffic through the proxy. On linux you can also use proxytunnel to tunnel through http proxies (if thats what you have available)
  • Matt
    Matt about 12 years
    Not possible if I don't run the server. In the end I asked the host to add a port map on his server from 1863 (MSN, unblocked) to 25565.
  • Zero
    Zero about 12 years
    What about on a mac?
  • RC1140
    RC1140 about 12 years
    @Foxtrot You can do the exact same thing on the mac , instead of using putty , use the Terminal application and the following command ssh <username>@<servername> -D 25565 , once that is connected you can change you system proxy by going to <Apple Icon> -> Preferences -> Network and then click on advanced for you current active network connection. Finally click proxies and enter the details into the Socks Proxy option and make sure its ticked
  • K1thros
    K1thros about 11 years
    I should add you can do this for as many servers as you want just change the first 25565 to any port number and then add a new server to the minecraft client using the new port.
  • Enigma
    Enigma about 11 years
    Edi your answer to include additional relevant information.
  • wombatonfire
    wombatonfire about 7 years
    Cool sketches, @erik!