Simple command to connect to FTPS server on Linux command line

command lineftpftps

I have an FTP and FTPS server where I can connect to easily with FileZilla. I'm looking for a linux CLI method. I thought lftp does it, but it seems weird. Is there another way?

Here is the method I found on Google to connect to my FTPS with lftp. But I hope there is an easier way:

lftp -c 'open -e "set ftps:initial-prot ""; \
   set ftp:ssl-force true; \
   set ftp:ssl-protect-data true; \
   put test.txt; " \
   -u "USERNAME","PASSWORD" \
   ftps://HOSTNAME:990 '

The code I got above looks like it will fail – haven't tried it yet as I don't like it, I know that the \ need to be at the end of the line.

I'm looking for a much simpler one liner. Here is how I connect from any FileZilla client and it works:

ftps://username:password@ftp.server.com/

Also, this works:

ftps://username:password@ftp.server.com/

Best Answer

I don't know whether this wasn't available on the 2013 version of lftp, but now you can simply do:

lftp -u YOUR_USER HOST_ADDRESS

For example, to connect to host 192.168.1.50 with user test, you only type the following:

lftp -u test 192.168.1.50
Related Question