sshmnt installation and useage for backups


So you want to use sshfs to do a backup?

We have had a couple of customers unsure what to do when the sshfs command is not found. Its not too hard to do. Debian based VPS can just run

apt-get install sshfs

Centos doesnt come with it by default and you need to install the rpmforge repositories to get it. You can do this as follows

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Then do an update

yum update

And then install it

[root@hostname ~]# yum install fuse-sshfs

Committing changes...
Preparing...                ########################################### [100%]
1:fuse                   ########################################### [ 50%]
2:fuse-sshfs             ########################################### [100%]
Done.
[root@hostname ~]#

Now to do backups,

$ mkdir sshmnt
$ sshfs username@backupspace.rimuhosting.com: sshmnt
$ cd sshmnt
$ ls -la
total 12
drwx------  1 1048 1048 4096 2008-10-28 15:55 .
drwxr-xr-x 11 carl carl 4096 2008-10-28 15:37 ..
drwx------  1 1048 1048 4096 2008-10-28 15:02 .ssh

$ cp -av /backupfiles/ sshmnt/

If you get errors when trying to use sshfs (e.g. ‘fuse: device not found’) make sure /dev/fuse exists. If not, create it with:

mknod /dev/fuse -m 0666 c 10 229

The following commands are available to users

/usr/lib/openssh/sftp-server
/usr/bin/rsync
/usr/bin/scp
/bin/ls
/bin/rm
/bin/mv
/bin/dd
/bin/cp
/bin/mkdir
/bin/rmdir
/bin/echo
/bin/ln
/bin/chmod
/bin/chown
/usr/bin/md5sum
/usr/bin/sha256sum

You can read more about backup options here http://rimuhosting.com/howto/backupspace.jsp