Thursday, March 27, 2008

SSHFS on FreeBSD

The following ports are needed:

sysutils/fusefs-kmod
sysutils/fusefs-sshfs

They depend on sysutils/fusefs-libs, packages are available on each at the moment for 6.3-Release.



Enable FUSE for system start up via rc.conf (I'd suggest rc.conf.local for PC-BSD) by adding this:

# enable File System in User Space
fusefs_enable="YES"


And fusefs will be ready op on reboot. As an alterntivie to rebooting one could load the module and start fusefs manually.

kldload /usr/local/modules/fuse.ko
/usr/local/etc/rc.d/fusefs start


After that, if you can ssh to the server you can at least mount your home directory via SSH :-)


sshfs username@host ~/mount_point


Since UNIX uses a numerical user and group id (uid, gid) to check file ownership and what not.. And my user account on my laptop was created in the PC-BSD install my uid & guid are 1001, on my OpenBSD machine hosting the files my UID & GID are set to more 'personal' integers, so they have to be mapped for my local account

sshfs -o uid=1001 -o gid=1001 username@host ~/mount_point


the username@host syntax is the same as scp, which means the common $USER@$VECTRA:/what/ever notation I use can be used for this as well, if the :/where/ever part is ommited it will use ones home directly from the server.


I have the fusefs-smbnetfs port installed but I'm not exactly fond of microsoft networking. I'm also very tempted to test a little bit of NFS over SSH, but I don't have much problem with using SSHFS from my laptop and SMB/CIFS from my desktop.



I've created a few SMB Shares on the OpenBSD machine that match up to parts of my home directory, tomorrow I'll start transferring files over. My Music, Videos, and Pictures directories amount for 2.8GB of files alone. So I don't have much problem with off loading them.


Since I always back crap up first and the files are non critical I can put up with being unable to use the 'current' set of them whenever my file servers off line, which is rare. It'll also be possible for me to set up a few cron jobs that'll backup my files more regularly: without needing to use the network (scp/ssh) directly! And I can always write a cronjob to seek and destroy those stupid Thumbs.db files Windows Explorer always makes.

I'm not sure about my ~/Documents and ~/code directories yet, that's almost 400MB of files right there but I'd rather not have to deal with out of date copies if Vectra goes off line. Although I could always set up my laptop to scp over a compressed nihgtly backup... We'll see where it goes after some live-testing.


In my ideal world, I think my entire home directory would be residing on the server but I'm not quite ready to trust the hardware here for that yet 0.o

No comments:

Post a Comment