Quick start¶
This builds uFTP with TLS, creates one user and connects to it. You need git, gcc, make and the OpenSSL development files.
# Debian and Ubuntu
sudo apt-get install git gcc make libssl-dev
git clone https://github.com/kingk85/uFTP.git
cd uFTP
make ENABLE_OPENSSL_SUPPORT="-D OPENSSL_ENABLED" LIBS="-lpthread -lssl -lcrypto"
The program is build/uFTP. Create a certificate (see TLS and certificates for the details):
sudo mkdir -p /etc/uftp/tls
sudo openssl req -x509 -newkey rsa:4096 -nodes -days 825 \
-keyout /etc/uftp/tls/key.pem -out /etc/uftp/tls/cert.pem \
-subj "/CN=ftp.example.com" -addext "subjectAltName=DNS:ftp.example.com"
sudo chmod 600 /etc/uftp/tls/key.pem
For a first installation, copy the programs and the configuration, create a home directory, and add a user with uftpctl adduser
(it asks for the name, the password — not shown — and the home, and writes the user with a PBKDF2 hash).
sudo cp build/uFTP /sbin/uFTP
sudo cp build/uftpctl /sbin/uftpctl
sudo mkdir -p /etc/uftp
sudo install -o root -g root -m 0600 uftpd.cfg /etc/uftp/uftpd.cfg
sudo install -d -o root -g root -m 0750 /srv/ftp/alice
sudo /sbin/uftpctl --config /etc/uftp/uftpd.cfg adduser
Answer alice to the name, the password twice, /srv/ftp/alice/ to the home, and press Enter for the other questions. The user is
written to USERS_FILE when the configuration has one, otherwise to uftpd.cfg; it can be edited by hand too (see Users),
and uFTP --hash-password makes a hash for it.
Check the configuration, then start from /etc/uftp so uFTP uses that same file.
(cd /etc/uftp && sudo /sbin/uFTP --check /etc/uftp/uftpd.cfg && sudo /sbin/uFTP)
Connect with any FTP client, for example FileZilla: host your-server, port 21, protocol FTP, encryption Require explicit FTP over TLS.
The first time the client asks you to trust the certificate. If something does not work, see Troubleshooting.