CurlFtpFS

CurlFtpFS is a filesystem for accessing FTP hosts based on FUSE and libcurl.

Note: As of February 2015, curlftpfs is reported to be extremely slow, see for example a Ubuntu bug report and a stackoverflow.com question.

Installation

Install the curlftpfs package.

Make sure the kernel module has been loaded.

# modprobe fuse

Mount FTP folder as root

Create the mount point and then mount the FTP folder.

# mkdir /mnt/ftp
# curlftpfs ftp.example.com /mnt/ftp/ -o user=username:password

If you want to give other (regular) users access right, use the allow_other option:

# curlftpfs ftp.example.com /mnt/ftp/ -o user=username:password,allow_other

Do not add space after the comma or the allow_other argument will not be recognized.

To use FTP in active mode add the option 'ftp_port=-':

# curlftpfs ftp.example.com /mnt/ftp/ -o user=username:password,allow_other,ftp_port=-

You can add this line to /etc/fstab to mount automatically.

curlftpfs#USER:PASSWORD@ftp.example.com /mnt/exampleorg fuse auto,user,uid=1000,allow_other,_netdev 0 0
Tip: You can use codepage="string" when having problems with non-US English characters on servers that do not support UTF8, e.g. codepage="iso8859-1"

To prevent the password to be shown in the process list, create a .netrc file in the home directory of the user running curlftpfs and chmod 600 with the following content:

machine ftp.example.com
login username
password mypassword

Mount FTP folder as normal user

You can also mount as normal user (always use the .netrc file for the credentials and ssl encryption!):

$ mkdir ~/example
$ curlftpfs -o ssl,utf8 ftp://example.com/ ~/example

if the answer is

Error connecting to ftp: QUOT command failed with 500

then the server does not support the option. Leave it out and all will be fine.

To unmount:

$ fusermount -u ~/example

Connect to encrypted server

In its default settings, CurlFtpFS will authenticate in cleartext when connecting to a non encrypted connection port. If the remote server is configured to refuse non encrypted authentication method / force encrypted authentication, CurlFtpFS will return a

# Error connecting to ftp: Access denied: 530

To authenticate to the ftp server using explicit encrypted authentication, you must specify the ssl option.

# curlftpfs ftp.example.com /mnt/ftp/ -o ssl,user=username:password

If your server uses a self-generated certificate not trusted by your computer, you can specify to ignore it

# curlftpfs ftp.example.com /mnt/ftp/ -o ssl,no_verify_peer,no_verify_hostname,user=username:password

For more details, see the man page.

Troubleshooting

Unable to access files with '#' in their filename

This is a bug which has been reported in Launchpad bug 783033 in 2011, confirmed in 2013 with no further activity as of writing this. An upstream bug report links to a potential patch.

gollark: The obvious solution is to make a Zogarth2 to combat Zogarth1.
gollark: Greetings, esolangs server members. I am gollark, otherwise known as osmarks, a human. As someone who is totally a human, I exist, and do human things such as (not limited to): consuming food; consuming water; sleeping; not sleeping; sitting in chairs; motion; social interaction; thought.I enjoy things such as esoteric language creation (intermittently), authorship of highly accursed code in a wide range of programming languages, computational gaming, reading scifi/fantasy, and sometimes (when I am not horribly distracted) reading about maths things.Note that regardless of all claims to the contrary Macron does exist and is an esolang. Additionally, if you are reading this, it is already too late.Feel free to DM me iff Riemann hypothesis!
gollark: Just use T&S!
gollark: Why?
gollark: Unfortunately, I was too cheap to get a green monitor.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.