Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am uploading data from a hosting server to an FTP server. There are many folders inside the main folder that I'm trying to send via FTP. put/wput won't work for me because they only handle individual files. I am now trying lftp but I am getting the following issue:

lftp -e "mirror -R /root/temp/mail  /mail1" -u user,pass dest_ip
Getting directory contents (0) [Making data connection...]

It stays at "Making data connection..." but meanwhile it creates the mail folder on my FTP server.

How can I upload all of my folders and files to the FTP server?

share|improve this question
Let me guess: your remote FTP server is Pureftp – Wesley Mar 30 '12 at 18:14
up vote 3 down vote accepted

You're likely hung in an SSL negotation. Add set ftp:ssl-allow off to either your individual command or your ~/.lftprc file. E.g.

lftp -e "set ftp:ssl-allow off; mirror -R /root/temp/mail /mail1" -u user,pass dest_ip

If you set it in your config, just know that you're keeping yourself from using any SSL encryption security features that might be on the remote host (HAW HAW HAW).

Bonus Answer: scp(1)

share|improve this answer
+1 for the Bonus Answer. FTP must DIE! :) – EEAA Mar 30 '12 at 18:45
Thanks. this solution is working. actually ssh port is disabled and i cudn't use scp so only solution was to find recursive ftp upload. – Kashif Mar 30 '12 at 18:48
@user115079 Glad to hear it's working. Don't forget to mark this as the answer when the option becomes available. It'll help future readers. – Wesley Mar 30 '12 at 19:13

ncftpput supports recursive directory upload. I have used it in the past but it has been a while. check the current manual for syntax and usage.

share|improve this answer

Your Answer


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.