Weblog
Thoughts which doesn't affect the world's peace

Using fuse file system over SSH

Did you ever had to check multiple directories on multiple linux boxes, to copy or maintain files on all of them and even create a batch files to automate your tasks?

Here is a simple way to implement grsync (graphical rsync backend) with fuse file system over ssh for (graphical) backup of certain directories:

First install the ssh fuse package – on fedora it’s called fuse-sshfs, on other systems it might be called sshfs-fuse or sshfs. You should do specific search for your distro.

yum -y install fuse-sshfs grsync

This will install sshfs and grsync with all the dependencies. Of course you will have to start this as root or use “sudo”.

Once the installation finished, you can test sshfs by mounting remote directory over ssh as a local mount.

mkdir /mnt/remotebox
sshfs remoteuser@remotebox:/absolute/path/to/directory /mnt/remotebox

OR if you want relative path to user homedir, use

sshfs remoteuser@remotebox:directory /mnt/remotebox

This command will not return any output on successful run, but you can see the result by using the “mount” command, or by issuing directory list with “ls /mnt/remotebox” (if the remote directory is not empty of course). You can unmount the fuse mount with:

fusermount -u /mnt/remotebox

At this point, every time you issue the sshfs command, you will be prompted for password. SSH doesn’t have an option to enter password as argument, for obvious security reasons. If you want to pass user password as SSH argument, there is some patch on the net, but I do not recommend using it. Of course, you could just mount all the directories needed from a terminal window, then use grsync to download the needed data, however, grsync is capable of issuing other commands before and after running rsync. You could always generate ssh key pairs and use them for passwordless login to the remote machine, in which case running grsync without additional preparations and (graphically) backing up/copying becomes quite easy. The same way can be used for automated (for example via cron) file sync.

Tags: , , , , ,

2 Responses to “Using fuse file system over SSH” »

  1. Free backlinks Says:

    Hello http://wordpress.home-world.org/2010/12/using-fuse-file-system-over-ssh-2/ admin. I discovered your “Weblog » Blog Archive » Using fuse file system over SSH” page via Google but it was hard to find as you were not on the first page of search results. I see you could have more traffic because there are not many comments on your site yet. I have found a website which offers to dramatically increase your rankings and traffic to your site: XXXXXX. They managed to get close to 1000 visitors/day using their services, you could also get lot more targeted traffic from search engines than you have now. I used their services and got significantly more traffic to my site. Hope this helps 🙂 Take care. Mandi

  2. Robbin Says:

    Nope, this doesn’t help me, it would have helped you, if I approved your comment without looking into it. I don’t usually answer spam bots, but I will just leave this retarded comment on my site, for fun and giggles.