Header Banner
wonderhowto.mark.png
Gadget HacksNext RealityFood HacksNull ByteThe Secret YumiverseInvisiverseMacgyverismsMind HacksMad ScienceLock PickingDriverless

How to Share Your LAN Minecraft World with Your Linux-Savvy Friends

Aug 15, 2012 05:42 PM
Aug 15, 2012 08:39 PM
Pixel art of a colorful Windows logo and a penguin resembling the Linux mascot.

First off, I would like to say two things. One, this is not for beginners; if you don't feel that you understand this how-to at all, do not try it. Second, never ever install random software or change settings if you do not trust the source.

If I haven't scared you yet, here is a trick you can use to let someone who isn't on the same local network access a world you have "Open to LAN". Since local addresses aren't routed onto the Internet, you need some trick to be able to allow others to connect.

For this, you need a friend who has a computer running Linux (or any other Unix-like system... I did this on FreeBSD), an account on that machine, and PuTTY, which is a program that lets you log in on remote computers.

Setting Up SSHD on the Linux Server

SSHD is running by default on most Linux-distributions. But you need to change some settings to allow the tunnel you are about to create to accept connections from the outside. So, open /etc/ssh/sshd_config and set (or add) "GatewayPorts yes", and then restart sshd._

Download and Install PuTTY

Back on your computer, download and install "a Windows installer for everything except PuTTYtel" from here.

Create a Small .Bat Script

Open Notepad and save it to a file with the suffix ".bat". I called mine mctunnel.bat:

@echo off

set /P MCREMOTEHOST="Remote host: "

set /P REMOTEUSER="Username: "

set /p MCMYPORT="LAN address to share: "

set SSHPORT=22

set MCREMOTEPORT=12345

"c:\Program Files (x86)\PuTTY\plink.exe" -v -x -a -T -C -noagent -ssh -P %SSHPORT% -R %MCREMOTEPORT%:%MCMYPORT% %REMOTEUSER%@%MCREMOTEHOST%

Note: That last line is supposed to be a very long line without any breaks.

You might want to change some settings. For example, I have my ssh-server running on another port that the standard port 22 and port 12345 can be changed to anything between 1025 and 65535. Check with the person who owns the Linux-computer which port he/she thinks is best. Also, your installation might have put plink.exe somewhere else, check that.

And you can change all of the "set /p" to something static, like "set REMOTEUSER=yownas" since it won't change..

Start Minecraft

Mmm, yea. Think most of you know how to do this.

Open to LAN

Press ESC and click on "Open to LAN". The chat window should say something like: "Local game hosted on 192.168.1.67:50664".

Start the Tunnel

Double-click your bat-script. It should ask you for "Remote host:" which is your friends Linux-computer, "Username:" which is the username you use to log in on that computer, and "LAN address to share:", just copy the string, in my case 192.168.1.67:50664, Minecraft told you.

You should now see a lot of text flashing by, and at the bottom it asks for your password to the Linux-machine. Enter it and you are done. :)

People Can Connect

SSH has now set up a tunnel between your machine and the Linux-computer. The local LAN-port for Minecraft has been mirrored to port 12345 on the other side.

So, instead of the disappointing "Connection refused: connect" when people try to connect to your local LAN-address, they can connect to your.friends.linux.computer:12345 and join you in killing creepers and walk into your redstone traps. :)

Just updated your iPhone? You'll find updated Apple Intelligence capabilities, new wallpapers, and enhancements to Calculator, PDF cropping, and Live Voicemail, among other useful features. Find out what's new and changed on your iPhone with the iOS 18.3 update.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!