Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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/
share|improve this question
    
You should probably separate this into two different questions, since they really are. –  Taegost Jul 23 '13 at 16:50
    
Please read: How do I format my posts using Markdown or HTML?. –  slhck Jul 23 '13 at 18:01

1 Answer 1

If by weird you mean a long command line with both types of quotes, just avoid it. Use a script and save a bookmark. There are probably no better ftp clients than lftp.

  1. save your lftp script in a file
  2. run lftp without any arguments
  3. source the script
  4. save a bookmark.
  5. delete rhe script (to get rid of the clear-text password)

Use the bookmark in the future. You'll have to figure out if ssl options are saved for the bookmark or if you have to persist those settings via a global lftp configuration file.


Sample script.

$ cat lftp.ssl.commands
user moo foopass
set ftps:initial-prot "";
set ftp:ssl-force true;
set ftp:ssl-protect-data true;
open ftps://HOSTNAME:990

Sample output.

$ lftp
lftp :~> source  lftp.ssl.commands
lftp HOSTNAME:~> dir
`ls' at 0 [Connecting...]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.