lftp :- directory listing fails due to firewall.

After getting into the server using lftp you may get the following error when ‘ls’ command is executed.

lftp [EMAIL PROTECTED]:~> ls
> `ls’ at 0 [Making data connection...]

This message will be shown for a long time without any other response. Relogging into the server in debug mode, you will get more a detailed error log.

<— 220———- Welcome to Pure-FTPd [TLS] ———-
<— 220-You are user number 7 of 50 allowed.
<— 220-Local time is now 13:54. Server port: 21.
<— 220-This is a private system – No anonymous login
<— 220-IPv6 connections are also welcome on this server.
<— 220 You will be disconnected after 15 minutes of inactivity.
—> FEAT
<— 211-Extensions supported:
<—  EPRT
<—  IDLE
<—  MDTM
<—  SIZE
<—  REST STREAM
<—  MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
<—  MLSD
<—  ESTP
<—  PASV
<—  EPSV
<—  SPSV
<—  ESTA
<—  AUTH TLS
<—  PBSZ
<—  PROT
<— 211 End.
—> AUTH TLS
<— 234 AUTH TLS OK.
—> OPTS MLST type;size;modify;UNIX.mode;UNIX.uid;UNIX.gid;
Certificate depth: 2; subject: /C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority; issuer: /C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority
Certificate depth: 1; subject: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global CA; issuer: /C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority
Certificate depth: 0; subject: /C=us/ST=Michigan/L=Ann Arbor/O=A2 Hosting, Inc./OU=Production Services/CN=*.a2hosting.com; issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global CA
<— 200  MLST OPTS type;size;sizd;modify;UNIX.mode;UNIX.uid;UNIX.gid;unique;
—> USER username
<— 331 User username OK. Password required
—> PASS password
<— 230-User username has group access to:  username
<— 230 OK. Current restricted directory is /
—> PWD
<— 257 “/” is your current location
—> PBSZ 0
<— 200 PBSZ=0
—> PROT P
<— 534 Fallback to [C]
—> PASV
<— 227 Entering Passive Mode (74,ip,ip,125,50,177)
—- Connecting data socket to (74.ip.ip.125) port 12977
Interrupt
—> LIST
—> ABOR
—- Closing aborted data socket

We need to edit the lftp configuration file to fix the issue. Open the file /etc/lftp.conf or create a file named .lftprc inside the home directory for the user and add the following line :

set ftp:ssl-allow no

This should fix the issue and mirror the contents.

Related posts:

  1. How To mirror or migrate a website from one server to another using lftp
  2. Kloxo restart fails giving entropy error

3 Comments

I’ve tried a couple of hours to see what’s causing this behavior until I found your post. Very useful!!

Thanks!

You need to warn people that this will let their password be sent in the CLEAR.
This is not a solution, it’s their firewall, it doesn’t think the connection is FTP when it opens that high port because it’s encrypted.
It doesn’t think it’s related.
The solution is for the firewall people to fix this quick because they are putting millions of servers at risk.

lejubila's blog » lftp: problema di timeout

[...] maggiori informazioni a riguardo consultate lftp :- directory listing fails due to firewall. | SupportSages, dove ho trovato la soluzione al problema. Mi piace questo post Non mi piace più questo [...]

Comment Form

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later