Mount sshfs on FreeBSD
This was a pain to get right, and all the forum posts and such I could
find must have been referring to an older version or something because
I just couldn’t not get errors like mount: unknown special file or file system
and fstab: /etc/fstab:6: Inappropriate file type or format
.
For reference, this is on FreeBSD 14.0-RELEASE-p5, and sshfs --version
says:
SSHFS version 3.7.3
FUSE library version 3.16.2
using FUSE kernel interface version 7.38
mount_fusefs [fuse4bsd] version: 0.3.9-pre1
Also, I’m not sure that all these things are completely necessary, but this works for me so I’m writing it down.
The line in /etc/fstab
should look like this:
user@host:/path /mnt/mountpoint fuse rw,mountprog=/usr/local/bin/sshfs,allow_other,reconnect,late 0 0
Add this to /boot/loader.conf
:
fusefs_load="YES"
And add this to /etc/rc.conf
:
kld_list="fusefs"
fusefs_enable="YES"
I’m fairly sure that having the kld_list
line in rc.conf
negates
the change to loader.conf
but I mean whatever.