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
sudo openssl req -x509 -newkey rsa:4096 -nodes -days 825 \
-keyout /etc/uFTP/key.pem -out /etc/uFTP/cert.pem \
-subj "/CN=ftp.example.com" -addext "subjectAltName=DNS:ftp.example.com"
sudo chmod 600 /etc/uFTP/key.pem
Copy the program and the configuration, then edit the users at the end of the file:
sudo cp build/uFTP /sbin/uFTP
sudo cp uftpd.cfg /etc/uftpd.cfg
sudo nano /etc/uftpd.cfg
sudo chown root:root /sbin/uFTP /etc/uftpd.cfg
sudo chmod 600 /etc/uftpd.cfg
Set at least one user (HOME_0 is the directory the user can see):
USER_0 = alice
PASSWORD_0 = a-long-secret
HOME_0 = /srv/ftp
Start it (root permissions are required):
sudo 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.
Passwords in the file
PASSWORD_n can be a hash instead of the password. Run ./uFTP --hash-password and put the line it prints in the file.