📜 ⬆️ ⬇️

Mount FTP resource as local FS

I wanted to somehow execute the find command in the ftp space, but any normal ftp server would not allow this, and I really wanted to find a solution.

So curlftpfs was discovered:

  $ aptitude show curlftpfs
 Package: curlftpfs
 Status: installed
 Automatically installed: no
 Version: 0.9.2-1
 Priority: optional
 Section: utils
 Accompanying: Ding Honghui <hhding@vobile.cn>
 Unpacked size: 111k
 Dependencies: libc6 (> = 2.7-1), libcurl3-gnutls (> = 7.16.2-1), libfuse2 (> = 2.6), libglib2.0-0 (> = 2.12.0), fuse-utils
 Description: filesystem to access FTP hosts based on FUSE and cURL
  CurlFtpFS is a tool to mount FTP hosts local as directories.  It is an FTP site and maps directory to the local filesystem. 
 
  Based on FUSE (filesystem in userspace) and the cURL library, CurlFtpFS has several features: 
  * support for SSLv3 and TLSv1 
  * connecting through tunneling HTTP proxies 
  * automatic reconnection if the server times out 
  * conversion of absolute symlinks to point back into the FTP filesystem
 Website: http://curlftpfs.sourceforge.net 

With this great tool you can perform almost any operation with an ftp-resource.

First, install the package:
')
  $ sudo aptitude install curlftpfs 

Then we mount the ftp-resource we are interested in:

  $ mkdir temp-ftpfs
 $ curlftpfs ftp: // $ USER: $ PASSWD @ $ HOST / temp-ftpfs
 $ cd temp-ftpfs
 $ ls
 $ find / -name '* .txt' 

Everything is very simple.

But it will be possible to authenticate only with root rights:
  $ sudo umount curlftpfs # ftp: // $ USER: $ PASSWD @ $ HOST / 

You can unmount it like this:

  $ fusermount -u temp-ftpfs 


PS : Free translation, with some additions, articles with Debian Administration .
PS : In my opinion it is more convenient to use sshfs, but if there is no access via ssh, then the above method will do something for something.

Source: https://habr.com/ru/post/85084/


All Articles