Search:  
Gentoo Wiki

Mounting_SFTP_and_FTP_shares


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Introduction

This HOWTO article deals with Filesystem in USErspace (FUSE), Linux Userland File System (LUFS) and (CurlFtpFS). The first two are libraries aimed at enabling the user to mount all kinds of filesystems (including SSH and FTP) at a local mountpoint. CurlFtpFS is a filesystem for acessing FTP hosts based on FUSE and libcurl. At the time of writing, LUFS is no longer in active development (last publicized version is from 2003) while FUSE seems to become more and more mainstream, staying in active development. Therefore I suggest using either FUSE or CurlFtpFS to ensure bug and performance fixes.

Installing and using FUSE

FUSE allows you to mount a variety of filesystems.

Prerequisites

You have to have File systems->Filesystem in Userspace support enabled in your kernel configuration in order to use FUSE (FUSE_FS=m or FUSE_FS=y). Otherwise you'll get compile error in the next step.

Both, sshfs and CurlFTPFS, have FUSE as dependency. It is easy in installation. Simply execute:

# emerge sys-fs/fuse

Then load the fuse module (as root):

# modprobe fuse

Mounting SFTP shares

Unfortunately, currently only the sshfs module is available through portage, so we'll use that as an example:

# emerge sys-fs/sshfs-fuse

To mount a remote host's file system through SSH at a local mount point, all you have to do is type:

# sshfs [user@]host:[dir] mountpoint

To allow access to mountpoint for non-root users simply execute:

# sshfs [user@]host:[dir] mountpoint -o allow_other

To unmount a remote host's file system type:

# fusermount -u mountpoint

You can also use umount to unmount. Note: It requires root rights:

# umount mountpoint

For more information, see:

Mounting FTP shares

Installing and using CurlFtpFS

Note: CurlFtpFS depends from FUSE so take a look at the Prerequisites section before emerging.

Installing CurlFtpFS from portage:

# emerge -av net-fs/curlftpfs
Warning: 2007-10-27, using curl-7.16.4

Whenever I try to create a directory I get the following error and the program crashes.

mkdir: cannot create directory `tst': Software caused connection abort

Solution: I also had this problem (along with a transport connection error). To fix it, I upgraded my curl to 7.18.1 and my kernel (with FUSE enabled) to v2.6.24-r8.

CurlFtpFS uses typical FTP syntax:

# curlftpfs ftp://ftp.gentoo.org/ /path/to/mountpoint 

To unmount an ftp host:

# fusermount -u /path/to/mountpoint/

/etc/fstab line:

curlftpfs#user:password@server.tld/remote/path /mount/point fuse user,disable_eprt,noauto

More Information on CurlFtpFS

Additional options:

For more information, see the man page:

# man curlftpfs

Installing and using LUFS

Warning: LUFS is no longer in active development. You should use CurlFtpFS instead.

If LUFS tries to get the remote /etc/password file, don't worry - that's normal, it's done by the load_credentials() function.

Installing LUFS from portage:

# emerge sys-fs/lufs

To mount an ftp host:

# lufis fs=ftpfs,host=ftp.kernel.org /mnt/lufis/ -s 

To Unmount an ftp host:

# fusermount -u /mnt/lufis

More Information on LUFS

Specific mount options:

For more information, see the man page:

# man lufs
Retrieved from "http://www.gentoo-wiki.info/Mounting_SFTP_and_FTP_shares"

Last modified: Fri, 05 Sep 2008 07:10:00 +0000 Hits: 54,592