29 December 2011

HowTo: Upload files to FTPS with cURL, Dolphin, and FileZilla

We've discussed setting up secured FTP with FTPS on VSFTP here.  This uses FTPS over port 21 and works well as Passive FTP.  We can connect using KDE's Dolphin and the KIO-Slave ftps://ftpuser:PaSsWoRd@1.2.3.4:21/ where 1.2.3.4 is the IP of the remote machine, ftpuser is the user account, and PaSsWoRd is the password, as we see here:





We can also connect with FileZilla as a setting the Server Type to 'FTPES' (or "Protocol: FTP" and "Encryption: Require explicit FTP over TLS") and Login Type to 'Normal' and using the needed credentials:



If you get an error which reads, "Error: GnuTLS error -12: A TLS fatal alert has been received.
Error: Could not connect to server", you need to either get an older version of FileZilla, or change your VSFTP settings to include "ssl_ciphers=HIGH".

Finally, we can upload files non-interactively with cURL using these settings (note this is all one line):

shell#  /usr/bin/curl --ssl-reqd --ftp-ssl-ccc -u ftpuser:PaSsWoRd ftp://1.2.3.4:21/ -v -k -T /home/lefty/testfile.txt
where 1.2.3.4 is the IP of the remote machine, ftpuser is the user account, and PaSsWoRd is the password.

0 comments: