How do I mount a directory in a remote machine using fuse? How do I mount a directory in a remote machine using fuse? unix unix

How do I mount a directory in a remote machine using fuse?


Too bad you can't use sshfs1 - it is my weapon of choice (iff I ever need to mount, otherwise rsync does nicely).

You could try curlftpfs which is capable of mounting an FTP 'share'.

Be sure to look at writing a .netrc (with proper permissions for security) so as to make this work conveniently


1 Why not?


You need to have some kind of network transport that the local and remote machines agree on for this: if not sshfs then smb or NFS or something.

It might help if you told everyone why you can't use sshfs.


Just like any other network file system, FUSE is going to need an underlying transport layer. It can't help you unless something on the remote machine is able to handle the actual I/O for you.

In your fuse arguments, you set up handlers for the things you want the file system to be able to handle, e.g:

static struct fuse_operations const myfs_ops = {        .getattr = my_getattr,        .mknod = my_mknod,        .mkdir = my_mkdir,        .unlink = my_rm,        .rmdir = my_rmdir,        .truncate = my_truncate,        .open = my_open,        .read = my_read,        .write = my_write,        .readdir = my_readdir,        .create = my_create,        .destroy = my_destroy,        .utime = my_utime,        .symlink = my_symlink};

That's code from one of my current FUSE implementations, re-written generically. As you can see, you'll need to at least implement open, read, write and close for a minimally functional FS.

Those members are functions, which do those operations. They can use HTTP, SSH, FTP, a custom protocol, whatever you want. But, you have to write them, and something on the remote server needs to respond to them.

To answer your question directly, FUSE (on it's own) isn't going to do what you want, unless you implement the functionality yourself.