Today I was trying to make the FTP backup for WordPress work but my CentOS webserver got stuck at ‘making data connection’ when using LFTP for the file transfer. LFTP is a nice file transfer program and despite the name it also supports HTTP, FISH, SFTP, HTTPS, FTPS besides FTP transfers. By default when you try LFTP to connect to a remote server this is what you might encounter:
[root@server backup]# lftp -u username,password myftp.servername
lftp username@myftp.servername:~> ls
`ls' at 0 [Making data connection...]
LFTP supports both FTP with or without SSL enabled. Apparently it tries to connect by default using SSL but my FTP server doesn’t support this.It will hang at ‘making data connection’ and that’s it. There are two ways how you can solve this. First of all you can do it using the command-line:
[root@server backup]# lftp -e "set ftp:ssl-allow off;" -u username,password myftp.servername lftp username@myftp.servername:~> ls drwxrwxrwx 1 1026 100 4096 Jan 25 19:06 Folder1 drwxrwxrwx 1 1024 100 12288 Jan 29 03:54 WPBackups lftp username@myftp.servername:~>
Just add “set ftp:ssl-allow off;” to make LFTP disable SSL. You can also disable it globally by editing the lftp.conf file:
[root@server backup]# vim /etc/lftp.conf
Use any text editor you like and add the following line to this file:
set ftp:ssl-allow false
Save and quit and now you can run the LFTP command without any additional parameters:
[root@server backup]# lftp -u username,password myftp.servername lftp username@myftp.servername:~> ls drwxrwxrwx 1 1026 100 4096 Jan 25 19:06 Folder1 drwxrwxrwx 1 1024 100 12288 Jan 29 03:54 WPBackups lftp username@myftp.servername:~>
That’s all there is to it! Happy FTP’ing! If this lesson has helped you please leave a comment or share it.
Thanks dude, you saved me the day
Hi Daniel,
I had the same problem back then. Security-wise is a good idea to use SFTP by default but the error message could be a bit less cryptic
Rene
THANK YOU. Saved my pasty white butt on this one.
I was also having this problem and disabling SSL didn’t work. I found the problem was because of CSF (the firewall). I had to disable passive mode, set the port range, and add the port range to csf.conf.
I added the following to /etc/lftp.conf:
set ftp:passive-mode off
set ftp:port-range 64200-64300
And I added 64200:64300 to the TCP_IN line in /etc/csf/csf.conf. So it should look something like this:
TCP_IN = “20,21,22,25,53,80,110,143,443,465,587,993,995,3306,64200:64300”
You will also need restart CSF (using ‘csf -r’)
Good morning!
Actually lftp issue AUTH TLS when this command is advertised by the FTP server.
My vps has a working proftpd TLS setup.