Dave's Grumblings

A rabbit, you say?

A weblog by Dave Arter

Accessing a Samba Share Remotely

While procrastinating hard in the library, I was taken by a sudden desire to listen to some music from my ever-expanding collection. The only slight drawback was that I'd left my iPod at home, which made it somewhat difficult given that my laptop is devoid of any music.
Realising that my desktop PC has its music shared (using Samba) with the rest of the home LAN, I set about trying to connect to it from my laptop on the University's VPN.
On Windows, the process is as follows:

  1. Execute net stop server from the command prompt (Win+R>cmd>OK). This stops Windows' Samba server on the local machine (we're effectively replacing the local server with the remote one).

  2. Open PuTTY and select the 'Tunnels' option from the 'SSH' menu in the left-hand pane

  3. For each of the following port numbers: 137, 138, 139, 445; enter the port number in the 'Source port' entry box and hostname:X (where hostname is the name of the box with the Samba shares, and X is the same port number you put in the 'Source port' box) in the 'Destination' entry box, and then click the 'Add' button.

  4. Return to the 'Session' option at the top of the left hand pane and enter the name of the remote host you're connecting to (in general, the hostname of the internet gateway on the home LAN).

  5. It's probably a good idea to save this little setup for future use, so give it a name in the 'Saved Sessions' box and hit 'Save'.

  6. Click the 'Open' button, and enter your username and password when prompted (assuming you don't have SSH keys set up...)

  7. You should now be able to enter \\127.0.0.1 in the Windows 'Run' box, and after authenticating with a valid Samba username and password you'll be presented with all the visible shares of the remote machine. These can be browsed and mapped to network drives, as with any Samba share.

  8. That's it!



Of course, this makes several assumptions - you need to have a machine on the home LAN you can SSH into, for one. But it's a simple hack that seems to work. It's also got the added benefit of being encrypted.

Something like Icecast would probably be a more sensible long-term solution, but for a quick and easy way of listening to your tracks, it does the job nicely. :)

[ Entry posted at: Mon 23 Jan 2006 18:30:06 UTC | 3 comment(s)... | Cat: Geeky ]

Daniel Lin writes:

Without the "net stop server" part:

Follow the instructions for How to install the Microsoft Loopback adapter.

Configure the adapter to some fixed IP, say 10.0.0.1, and uncheck "File and Printer Sharing for Microsoft Windows".

In PuTTY, under Tunnels, type "10.0.0.1:139" into the Source box, "127.0.0.1:139" into the Destination box, make sure "Local" is selected, and click "Add".

Everything else is the same. Now you can browse to \\10.0.0.1. You can change the IP to whatever you want, if 10.0.0.0/8 is already in use.

[ Tue 24 Jan 2006 15:02:54 UTC ]

Dave Arter writes:

Sweet, thanks for the tip Daniel!

[ Tue 24 Jan 2006 15:23:18 UTC ]

moogman writes:

Haha dude, that's awesome. I never thought about doing that :)

[ Sat 18 Mar 2006 15:57:53 UTC ]

Add Comment

Validate : XHTML / CSS / RSS / ATOM :: SUCS Blogs Version 209