Mounting remote directories over SSH from Windows, Linux and the mac.

I have a Linux server that I like very much. It’s at the hart of my home network and it houses all the data and projects I’m working on. My music collection, the podcasts I’ve downloaded, textfiles and scripts I’m working on and so forth.

The downside is that I don’t always have access to these files. I work on a variety of operating systems (A Windows laptop for work, A Mac for my creative splurges and a Linux workstation to fool around with). There are several solutions to “dail in” to your home network of course but somewhere I’ve found SSH to be one of the simplest ways to access remote machines, tunnel traffic and … access files.

Sometimes you want remote files to behave like local ones.

The problem is that sometimes you want to have your remote files and folders behave just like your local files and folders, without having to worry about vpn’s, netbios or FQDN names of certain files. You just want the data on your remote machine to act like data on your local one. Enter SSHFS.

SSHFS is based on SSH, a simple elegant and secure protocol that not only lets you connect to a remote server to run commands in a terminal environment, it’s also a pretty good poor-mans VPN you can tunnel all your tcraffic through (via SSHuttle). It’s also good to copy over files via secure ftp (with Filezilla for example). But copying files back and forth isn’t handy. You want real-time access to the juice man. Let’s get you fixed up and mount your remote linux folders, natively into your filesystem on Windows, Mac and Linux.

SSHFS on a Linux client.

SSHFS on Linux
On your Linux client you need to install sshfs
sudo apt instal sshfs

sudo apt instal sshfs

Then you create a directory on your local machine where you want to mound the files
Once installed you connect to your remote machine with the command

sshfs username@remotemachine:/directoryonremotemachine /directoryonlocalmachine

SSHFS from a MacOs client.

SSHFS on Mac
MacOs does not have sshfs capabilities by default but these can easily be installed via Brew
When brew is installed you can install sshfs with the brew command.
To mount your remote directory just use the same command as on Linux/

 brew install sshfs 
sshfs username@remotemachine:/directoryonremotemachine /directoryonlocalmachine

SSHFS from a Windows Machine

That also works but it does require a little more work to get it done AND Windows won’t let you mount to a folder nativey but points you to a driveletter instead.

First off install the following two applications:

Next all you need to do is open a command line window and enter the following command.
net use .<yourdrive>: \sshfs\yourusename@remotehost….\directorystartingfromroot

 net use x: \sshfs\me@thedeathstar.empire....\deathstarplans R3belsRscumm 

In the end.

At the end of the day using SSHFS is a great way to quickly access files on a remote Linux system while having the files and folders integrated into the filestructure of whatever operating system you use. The additional encryption provided by SSH gives you good security. Both on Linux and on the mac you will be asked to authenticate with your password. If you don’t want to do that you setup ssh key exchange (see here) on how that is done. You can enter the commands in a script that you can just run (like a logon script).

Beware then when you are doing this on Windows your logon script might contain your login and your password for the remote system in clear text. So keep that somewhere safe.

Related Posts

kw707 : Downloading Torrents from anywhere.

This week we teach you the art of downloading. Wiseguy Daniel Messer tells you all about how to use the Piratbay browser to anonymise your traffic through  the TOR network, circumventing censorship,  nosy ISP’s and even our lovely friends over at the NSA.  After this insightful tutorial on using this ‘portable app’ its my turn to tell you about “Transmission”, A simple client to download torrent files, with a twist. We show you how to set it up, use it AND control it from just about anywhere. Ever been on your smartphone an thought .. Damn, I wish I could download this torrent back home ? We teach you how to use Transmission from anywhere on any device equipped with a browser. (Even from your phone). Stay tuned till the end because we have a special holiday-cheer announcement for a very special member of the community. 


Related Posts