Dead simple SSH tunnel for my Windows users

2

1

I'm running a Minecraft server, and many of my users are on a college campus whose network doesn't play nicely with Minecraft. I'm looking to package together a dead-simple way of creating a SSH tunnel to the server. Ideally, they would just double-click something to set it up. I'm prepared to do significantly more work on my end, if need be.

If there isn't anything simpler, I can just tell them to use PuTTY, but I'm afraid I might scare some of them away.

Thom Smith

Posted 2012-10-05T19:59:50.277

Reputation: 617

1There is no policy forbidding connecting to Minecraft servers from this campus. As far as I know, the connection problems are a side effect of their overzealous anti-torrent measures. – Thom Smith – 2012-10-05T20:25:06.323

Not sure why this is being voted to close as off-topic, as you're not asking for a pre-made product. Seems valid to me, a lack of research effort shown though. :/ – Ƭᴇcʜιᴇ007 – 2012-10-06T15:31:40.490

The close vote was due to the question ostensibly violating the campus network's terms of use. The relevant comment has since been removed. – Thom Smith – 2012-10-06T15:59:10.590

Ahhhhhh.. That makes sense. :) – Ƭᴇcʜιᴇ007 – 2012-10-06T16:06:24.577

Answers

5

Bundle PuTTY's plink.exe and a batch script that sets up the tunnel:

@plink -v -N -D 1234 user@host

Replace -D 1234 with your desired tunnel options (-D, -L, -R; syntax same as in OpenSSH). (According to comments, you need -L 25565:localhost:25565.)


To avoid users having to answer the SSH key verification prompt:

  1. export PuTTY's cached key to a .reg file:

    reg export HKCU\Software\SimonTatham\PuTTY\SshHostKeys hostkey.reg
    
  2. open hostkey.reg in Notepad;

  3. in the file, delete all other host keys except your Minecraft tunnel host;

  4. add @reg import hostkey.reg as the first line of your batch script.

user1686

Posted 2012-10-05T19:59:50.277

Reputation: 283 655

So, a .bat file in plink.exe's directory containing @plink -v -N -D 25565 miner@example.com to connect localhost:25565 to example.com:25526? – Thom Smith – 2012-10-05T20:21:51.613

2-D is short for DynamicForward, also knows as a SOCKS Proxy, so you'd have to set up Minecraft to use a SOCKS proxy pointing to port 1234. Like @grawity said, use a different tunnel option. I'm assuming THEY will run the putty session (plink) so swap the '-D 1234' with this: -L1234:localhost:1234 This will allow the client to connect to their own PC on port 1234, the tunnel will transfer the connection to the server and shove the data to localhost:1234 (from the point of view of the server, so itself). Replace Mincraft's ports with 1234. – UtahJarhead – 2012-10-05T20:28:45.357

1The above comment assumes that the minecraft server is running on your ssh server. Otherwise, instead of 'localhost', use the IP of the Minecraft server. – UtahJarhead – 2012-10-05T20:29:33.237