FTP

FTP allows to download but also and upload files from a server. Alternatively rcp the remote copy could be used.

FTP servers

There are different ftp servers:

  1. Apacheoffers also a ftp module.

  2. emerge vsftpd to have a standalone ftp server can be installed by doing and is described in further detail.

Open and edit /etc/vsftpd/vsftpd.conf that holds the configuration.

It can either be standalone and watch incoming ftp requests (listen=Yes) or using xinetd for that (listen=No). Type man vsftpd.conf for help. There is a initscript rc-update add vsftpd default. Finally the directory shared by default and anonymous user is ~/ftp/ make sure the file system does also allow to access this directory. The use of FTP to make such a directory easily usable and visible but hide the rest of the computer with all unnecessary details for the up and download. In konqueror type ftp://192.168.1.34/ and you will see the contents of ~/ftp (assuming the correct IP address is given).

There is also a log file: /var/log/vsftpd.log

FTP clients

To have a stand alone gui tool gftp

or FileZilla

Important

Since upload can take a while check in FileZilla window Transfer Queue the Queued files.

Use mc with ftp link ftp://<username>:<password>@<url>

Important

The nice thin is mc escapes the password but the not so nice thing is it looses it and next time asks for the password.

Or simply type in ftp://<Uri> into a browser.

lftp

lftp can be used to keep a remote in sync with local

lftp ftp://<username>:<password>@<url> -e "mirror -e --ignore-time -R <local dir><remote dir>; quit"

-e or --delete means delete remote files that are no more used

-R or --reverse means transfer is local to remote

lftp -c "open ftp://<username>:<password>@<url>; mirror /<remote dir><local dir>" downloads the changes on the remote content to the local content. -c <command> is an other way to call lftp

Unison could then be used to synchronize the <local dir> with some other local dir.

lftp -c "open ftp://<username>:<password>@<url>; mirror --delete --reverse /<local dir> /<remote dir>" then uploads the changes to the remote content.

curlftpfs

Instead of dealing with an Ftp client curlftpfs mounts a Ftp server to the local filesystem where tools as unison can be used to sync.

To mount as regular user (If the password has characters as $ ! then use the escape character as \$ or \!)

curlftpfs ftp://<url>/ <local dir>/ -o user=<username>:<password>,utf8

or as root

curlftpfs -o allow_other ftp://<username>:<password>@<Url><Dir>

to unmount fusermount -u <Dir>

See https://wiki.gentoo.org/wiki/CurlFtpFS


Linurs startpage