paulgorman.org/technical

SSHFS

SSHFS lets us mount a remote filesystem over ssh.

SSHFS is more convenient that SFTP, more secure than NFSv3, and far easier to set up than NVSv4. It can be used by an unprivileged user, and requires no special configuration on the server. SSHFS achieves performance comparable to NFS in some scenarios.

Example

%  sshfs blinky:/data/share ~/blinky -o compression=yes,cache=yes,kernel_cache,large_read,idmap=user,reconnect

Compression will help performance in most cases, depending on the network in question and the CPUs involved.

On a trusted LAN, try faster/weaker encryption with -o Cipher=arcfour. However, arcfour might actually perform worse than the more secure AES default if both client and server CPUs support AES-NI.

Unmount like:

%  fusermount -u ~/blinky

SSHFS volumes can be mounted in /etc/fstab too:

me@foo.example.com:/data/share /var/foo.example.com/share fuse.sshfs allow_other,idmap=user,IdentityFile=/home/me/.ssh/id_rsa,reconnect 0 0

Installation

Debian: apt-get install sshfs.

FreeBSD: pkg install fusefs-sshfs.

OpenBSD: pkg_add sshfs-fuse.

Testing

A handy testing tools is bonnie++, which gives us measures of random and sequential reads and writes.

%  /usr/sbin/bonnie++ -d ~/blinky/tmp/ -s 8192 -r 4096 -n 256

iozone is another testing tool to look at.