Saturday, February 10, 2007

Secure Remote Filesystems

Accessing files on remote systems can sometimes be a big pain in the ass (BPITA). You can use Samba to mount filesystems, but that means setting up a Samba server on the remote system and being susceptible to security problems. There is an alternative, called SSHfs that uses SSH to mount the remote filesystem as if it were a local directory.

In Ubuntu it is easy to get working:
sudo apt-get install sshfs
sudo joe /etc/modules
Add fuse on a line by itself
sudo modprobe fuse (only needed to get it loaded now)
sudo gpasswd -a username fuse
newgrp fuse
mkdir ./mnt/remote
sshfs user@remote.system: ./mnt/remote/
Now your remote account's files are accessible right there on the local system, via a secure link. This works for the MAC as well, if you install MACfuse and Secure Remote Disk.

Unmount the remote filesystem using the unmount command:
fusermount -u ./mnt/remote
This is better than Samba because you are using secure link to transfer the data, it is less complicated and therefore less likely to be compromised than Samba. Building on top of things that do 'just 1 thing' is the Unix way and is a large part of why Unix systems and programming practices are more secure and more flexible than those you see with primarily GUI centric systems.

No comments: