Cant FTP: Error listing directory
- Reply to topic
- Log in
Advertisement
- anjanesh
- Joined:
- 2007-11-10
- Posts:
- 4
- Location:
- Mumbai, India
2007-11-10 10:28
Hi
Im trying to connect to a remote server via FTP (port 21) but I get this this error msg :
Timeout detected. Could not retrieve directory listing PORT command successful Error listing directory '/'.
I tried connecting to various linux hosts but all returned the same msg.
But SFTP works though.
WinSCP 4.0.4
Is there some setting I got to use to connect via FTP ?
Thanks
Reply with quote
Advertisement
-
G Jones
Guest
2007-11-11 21:40
I am getting the same error — I was hoping 4.05 was going to work on my w98se system — as I had failed to get it working due to a netapi32 problem previously.
Timeout detected.
Could not retrieve directory listing
PORT command successful
Error listing directory ‘/’.
Reply with quote
-
martin◆
Site Admin -
- Joined:
- 2002-12-10
- Posts:
- 38,466
- Location:
- Prague, Czechia
2007-11-13
Have you tried passive mode?
Reply with quote
- anjanesh
2007-11-13 12:47
Thank You! It now works.
Can it not auto-detect which mode it should try? Or try active first, if fail, try passive?
Reply with quote
- snowwolf
- Joined:
- 2007-12-05
- Posts:
- 1
2007-12-05 17:34
How can I set WinSCP to use passive mode FTP?
Reply with quote
Advertisement
- anjanesh
- Joined:
- 2007-11-10
- Posts:
- 4
- Location:
- Mumbai, India
2007-12-05 18:06
After selecting FTP (from the drop down),
goto Connection section (select from left-hand pane of menus)
and check Passive. By default its unchecked.
<invalid hyperlink removed by admin>
Reply with quote
-
Tias
Guest
2008-01-11 19:08
I have the same problem but i can`t check passive mode. it`s faded (if you know what I mean)
Reply with quote
-
striped67
Guest
2008-01-15 18:07
Select the stored session, click Edit. Click on Connection on the left-hand side and the Passive mode checkbox should be enabled. Don’t forget to save the session after you’ve changed it.
Took me a while to work it out, but now it’s working like a dream.
Reply with quote
- jigujigu
- Joined:
- 2008-01-16
- Posts:
- 2
2008-01-17 03:05
how i can set passive mode in command line.
i am not using Open Session command
this is my command line
winscp.exe /script=send.scp
this is my Send.Scp
file
option batch on option confirm off Open ftp://MyId03:Pass11@MyServer:21 PUT C001.DAT C001.DAT
I am using WinSCP 4.0.6
thank’s
Jigu Haslim
Reply with quote
Advertisement
-
martin◆
Site Admin -
2008-01-17
how i can set passive mode in command line.
Edit 2021: WinSCP now uses passive mode by default. So most of this topic is mostly irrelevant in with the latest version of WinSCP. You are likely facing a different problem than described here.
Reply with quote
-
martin◆
Site Admin -
2008-02-14
jigujigu wrote:
how i can set passive mode in command line.
This issue is being tracked already.
Reply with quote
-
Gus
Guest
2008-03-04 16:05
Bless you people.
I’ve spent 3 days banging my head on my desk, emailing my host, talking to our IT people, asking God and anyone else that would listen, how to solve this problem.
PASSIVE MODE was all it took…. thank you so much people on this forum, you have answered my prayers.
Reply with quote
- anjanesh
2008-03-04 18:37
@martin should make it passive by default or auto-try in passive mode when active mode fails.
Reply with quote
Advertisement
-
martin◆
Site Admin -
2008-03-05
@anjanesh: This request has been added to tracker.
Reply with quote
-
deviljoo
Guest
2008-11-07 18:31
I had the same problem to, but i turned off the windows firewall and that fixed the error…
Reply with quote
-
alpesh
Guest
2009-02-20 08:09
Hello,
After Passive mode it worked for me
Reply with quote
-
martin◆
Site Admin -
2009-02-23
See documentation for hints and solutions regarding «Error listing directory» error.
Reply with quote
Advertisement
-
cypherx
Guest
2009-08-05 15:51
Passive mode didn’t work for me.
I’m using WinSCP 4.1.5 (Build 410)
I’m copying all my saved sites out of an old netmanage.95 ftp client into WinSCP. I have a site that is FTP that will not list any files in the default directory. I can’t get WinSCP to display the default directory.
I tried leaving Remote Directory blank, and I also tried putting in the name without a slash, and also with a slash from the output of a Wireshark analyzer after logging in with the working FTP Client.
I’m getting
Could not retrieve directory listing
CWD cmd failed : EDC5129l No such file or directory. (errno2=0x0594003D)
I click OK and I’m connected but the directory doesn’t show any files. In the upper right drop down I see the directory name ‘FX04394.’ which is exactly the home directory when windowssystem32ftp (command line) places you upon login.
Thanks for your help.
Reply with quote
-
martin◆
Site Admin -
2009-08-05
@cypherx: What is your FTP server and operating system?
Reply with quote
-
cypherx
Guest
2009-08-19 12:57
I’m not entirely sure, it’s not our FTP server, it’s a vendor we use. I have to use a different FTP client for that one site and it works fine. Too bad because I wanted to consolidate and use WinSCP for everything since it also does SFTP/SSH2 in addition to regular FTP.
Here’s an output of the STAT command:
211-Server FTP talking to host xxx.xxx.xxx.xxx, port 36214 211-User: xxxxxx Working directory: xxxxxx. 211-The control connection has transferred 1715 bytes 211-There is no current data connection. 211-The next data connection will be actively opened 211-to host xxx.xxx.xxx.xxx, port 36214, 211-using Mode Stream, Structure File, type ASCII, byte-size 8 211-Automatic recall of migrated data sets. 211-Automatic mount of direct access volumes. 211-Auto tape mount is allowed. 211-Inactivity timer is set to 300 211-Timer FTPKEEPALIVE is set to 600 211-VCOUNT is 59 211-ASA control characters in ASA files opened for text processing 211-will be transferred as ASA control characters. 211-Trailing blanks are removed from a fixed format 211-data set when it is retrieved. 211-Data set mode. (Do not treat each qualifier as a directory.) 211-ISPFSTATS is set to FALSE 211-Primary allocation 30 tracks. Secondary allocation 30 tracks. 211-FileType SEQ (Sequential - default). 211-Number of access method buffers is 5 211-RDWs from variable format data sets are discarded. 211-Records on input tape are unspecified format 211-SITE DB2 subsystem name is DB2 211-Data not wrapped into next record. 211-Tape write is not allowed to use BSAM I/O 211-Truncated records will not be treated as an error 211-JESLRECL is 80 211-JESRECFM is Fixed 211-JESINTERFACELEVEL is 1 211-Server site variable JESTRAILINGBLANKS is set to TRUE 211-Migrate Volid is ARCIVE 211-Confidence level in data transfers is neither checked nor reported 211-ENcoding is set to SBCS 211-Outbound SBCS ASCII data uses CRLF line terminator 211-Outbound MBCS ASCII data uses CRLF line terminator 211-Server site variable MBREQUIRELASTEOL is set to TRUE 211-Server site variable UNICODEFILESYSTEMBOM is set to ASIS 211-DBSUB is set to FALSE 211-SBSUB is set to FALSE 211-SBSUBCHAR is set to SPACE 211-SMS is active. 211-Data sets will be allocated using unit DISK 211-New data sets will be catalogued if a store operation ends abnormally 211-Single quotes will override the current working directory. 211-UMASK value is 027 211-Process id is 50331936 211-Checkpoint interval is 0 211-Authentication type: None 211-TLS security is supported at the DRAFT level 211-'TCPIP.MODEL.DCB' will be used as the DCBDSN model data set 211-Port of Entry resource class for IPv4 clients is: TERMINAL 211-Record format FB, Lrecl: 80, Blocksize: 6160 211-Server site variable LISTSUBDIR is set to TRUE 211 *** end of status *** 211- Extensions supported AUTH TLS PBSZ PROT 211 End
Reply with quote
-
martin◆
Site Admin -
2009-08-21
@cypherx: Hmm, I’m not familiar with this one. Sorry.
Reply with quote
Advertisement
-
DavidH
Guest
2010-05-17 09:37
How do I get the PASV mode to be available? Even when creating a new connection I don’t get the option of selecting a PASV.
Reply with quote
-
martin◆
Site Admin -
2010-05-19
@DavidH: Please read documentation. If that does not help, come back.
Reply with quote
-
maya
Guest
2010-08-27 16:49
i have the same problem with above.
Timeout detected.
Could not retrieve directory listing
PORT command successful
Error listing directory ‘/’.
Then, i checked passive mode.
But it still have problem.
Timeout detected.
Could not retrieve directory listing
Entering Passive Mode ().
Error listing directory ‘/’.
Can anybody help me?
Reply with quote
-
martin◆
Site Admin -
- Joined:
- 2002-12-10
- Posts:
- 38,466
- Location:
- Prague, Czechia
2010-09-01
Please post a full log file showing the problem.
To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. For posting extensive logs you may use pastebin or similar application. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
Reply with quote
Advertisement
- DragonRider317
- Joined:
- 2010-09-30
- Posts:
- 3
2010-09-30 16:07
I am having similar problem. I have checked passive mode.
My log is as follows:
. 2010-09-30 10:10:49.910 -------------------------------------------------------------------------- . 2010-09-30 10:10:49.910 Session name: jdude@denali.zzzzz.org . 2010-09-30 10:10:49.910 Host name: denali.zzzzz.org (Port: 990) . 2010-09-30 10:10:49.910 User name: jdude (Password: Yes, Key file: No) . 2010-09-30 10:10:49.910 Tunnel: No . 2010-09-30 10:10:49.910 Transfer Protocol: FTP . 2010-09-30 10:10:49.910 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec . 2010-09-30 10:10:49.910 Proxy: none . 2010-09-30 10:10:49.910 FTP: FTPS: Implicit SSL/TLS; Passive: Yes [Force IP: No] . 2010-09-30 10:10:49.911 Local directory: C:Usersj.dudeDocuments, Remote directory: /net/XXXX, Update: No, Cache: Yes . 2010-09-30 10:10:49.911 Cache directory changes: Yes, Permanent: Yes . 2010-09-30 10:10:49.911 DST mode: 1 . 2010-09-30 10:10:49.911 -------------------------------------------------------------------------- . 2010-09-30 10:10:50.196 Connecting to denali.zzzzz.org:990 ... . 2010-09-30 10:10:50.196 m_pSslLayer changed state from 0 to 1 . 2010-09-30 10:10:50.196 m_pSslLayer changed state from 1 to 2 . 2010-09-30 10:10:50.196 m_pSslLayer changed state from 2 to 4 . 2010-09-30 10:10:50.202 Connected with denali.zzzzz.org:990, negotiating SSL connection... . 2010-09-30 10:10:50.373 SSL_connect: SSLv3 read server hello A . 2010-09-30 10:10:50.373 SSL_connect: SSLv3 read server certificate A . 2010-09-30 10:10:50.373 SSL_connect: SSLv3 read server key exchange A . 2010-09-30 10:10:50.373 SSL_connect: SSLv3 read server done A . 2010-09-30 10:10:50.373 SSL_connect: SSLv3 write client key exchange A . 2010-09-30 10:10:50.373 SSL_connect: SSLv3 write change cipher spec A . 2010-09-30 10:10:50.374 SSL_connect: SSLv3 write finished A . 2010-09-30 10:10:50.374 SSL_connect: SSLv3 flush data . 2010-09-30 10:10:50.607 SSL_connect: SSLv3 read finished A . 2010-09-30 10:10:50.608 Using TLSv1, cipher TLSv1/SSLv3: EDH-RSA-DES-CBC3-SHA, 1024 bit RSA . 2010-09-30 10:10:50.609 SSL connection established. Waiting for welcome message... < 2010-09-30 10:10:50.609 220 Content Services FTPS Server ready. Access to this system is limited to authorized users for company business purposes only. Unauthorized access to or use of this system is prohibited and may subject you to civil and criminal prosecution. Use of this system may be monitored for the purpose of maintaining system security, and system information may be accessed or disclosed under limited circumstances. > 2010-09-30 10:10:50.609 USER jdude < 2010-09-30 10:10:50.613 331 Password required for jdude. > 2010-09-30 10:10:50.614 PASS ****** < 2010-09-30 10:10:50.712 230 Login successful. > 2010-09-30 10:10:50.712 SYST < 2010-09-30 10:10:50.718 215 System type UNIX > 2010-09-30 10:10:50.718 FEAT < 2010-09-30 10:10:50.723 500 Command not supported: FEAT > 2010-09-30 10:10:50.723 PBSZ 0 < 2010-09-30 10:10:50.729 200 Command successful. > 2010-09-30 10:10:50.729 PROT P < 2010-09-30 10:10:50.734 200 Command successful. . 2010-09-30 10:10:50.736 Connected . 2010-09-30 10:10:50.736 Got reply 1 to the command 1 . 2010-09-30 10:10:50.736 -------------------------------------------------------------------------- . 2010-09-30 10:10:50.736 Using FTP protocol. . 2010-09-30 10:10:50.736 Doing startup conversation with host. > 2010-09-30 10:10:50.738 PWD < 2010-09-30 10:10:50.744 257 "/" . 2010-09-30 10:10:50.744 Got reply 1 to the command 16 . 2010-09-30 10:10:50.746 Changing directory to "/net/XXXX". > 2010-09-30 10:10:50.746 CWD /net/XXXX < 2010-09-30 10:10:50.758 250 Command successful. . 2010-09-30 10:10:50.758 Got reply 1 to the command 16 . 2010-09-30 10:10:50.758 Getting current directory name. > 2010-09-30 10:10:50.758 PWD < 2010-09-30 10:10:50.763 257 "/net/XXXX" . 2010-09-30 10:10:50.764 Got reply 1 to the command 16 . 2010-09-30 10:10:50.766 Retrieving directory listing... > 2010-09-30 10:10:50.766 TYPE A < 2010-09-30 10:10:50.769 200 TYPE set to A. > 2010-09-30 10:10:50.770 PASV < 2010-09-30 10:10:50.775 227 Entering Passive Mode (10,248,50,104,230,166) > 2010-09-30 10:10:50.775 LIST < 2010-09-30 10:10:50.781 150 ASCII data connection for directory listing. . 2010-09-30 10:11:05.113 Timeout detected. . 2010-09-30 10:11:05.113 Could not retrieve directory listing . 2010-09-30 10:11:05.113 Got reply 1004 to the command 2 * 2010-09-30 10:11:05.118 (ESshFatal) Lost connection. * 2010-09-30 10:11:05.118 Timeout detected. * 2010-09-30 10:11:05.118 Could not retrieve directory listing * 2010-09-30 10:11:05.118 ASCII data connection for directory listing. * 2010-09-30 10:11:05.118 Error listing directory '/net/XXXX'.
I am using Windows 7.
Let me know if you have any suggestions. Thank you.
Reply with quote
-
martin◆
Site Admin -
2010-10-01
DragonRider317 wrote:
I am having similar problem. I have checked passive mode.
Are you able to connect with any other FTP client?
Reply with quote
- DragonRider317
2010-10-01 15:02
martin wrote:
Are you able to connect with any other FTP client?
I was able to connect to the FTP site with FileZilla in passive mode.
Reply with quote
-
martin◆
Site Admin -
2010-10-04
Can you post a filezilla log? Have you checked your firewall configuration/log, if it blocks WinSCP?
Reply with quote
Advertisement
- DragonRider317
2010-10-21 21:55
I was able to fix my issue by checking the «Force IP address for passive mode connections» option in the FTP options screen.
Reply with quote
- Guest
2010-12-18 09:43
anjanesh wrote:
After selecting FTP (from the drop down),
goto Connection section (select from left-hand pane of menus)
and check Passive. By default its unchecked.
<invalid hyperlink removed by admin>
Thanks for Your help!
Very useful advice.
Frankly saying, I didn’t believe it works until I tried it on my own.
Reply with quote
-
Nettie
Guest
2011-03-05 14:49
Those who say they cannot activate passive mode need to EDIT their already saved session. Or delete and create a new one if that is easier.
As stated in post above I was unable to access passive mode (grayed out) then after reading a previous post it explained to edit. Before this I was turning off my firewall and that worked. But choose passive mode instead.
Also these post really help so thank you.
Reply with quote
-
Johnie
Guest
2011-07-07 15:59
I had the same issue but changing the Tnternet Protocol version from Auto to IPv4 fixed it for me.
Reply with quote
Advertisement
- pe
- Joined:
- 2011-11-09
- Posts:
- 1
2011-11-09 09:28
Hi,
I have a similiar problem: initial directory listing after having connected over FTPS fails.
WinSCP runs in a Win7 VM on a Linux host. I’m behind a firewall. Therefore the host system tunnels traffic over SSH offering a local SOCKS5 proxy. WinSCP in the VM uses this proxy. FTP without SSL encryption works fine…
FTP(S) Server <—> External Proxy <-SSH-> Host system/SOCKS5 proxy:5555 <—> VM
— Firewall of the VM is deactivated
— Passive mode is activated
— I tried «Force IP address for passive mode connections» which gives me also an error. But with this configuration, the file explorer opens displaying an empty directory «/ <root>» on server side.
LOG (Without «Force IP address (…)»)
. 2011-11-09 09:20:18.878 —————————————————————————
. 2011-11-09 09:20:18.878 WinSCP Version 4.3.2 (Build 1201) (OS 6.1.7601 Service Pack 1)
. 2011-11-09 09:20:18.878 Login time: Mittwoch, 9. November 2011 09:20:18
. 2011-11-09 09:20:18.878 —————————————————————————
. 2011-11-09 09:20:18.879 Session name: ***
. 2011-11-09 09:20:18.879 Host name: ftp.*** (Port: 21)
. 2011-11-09 09:20:18.879 User name: *** (Password: Yes, Key file: No)
. 2011-11-09 09:20:18.879 Tunnel: No
. 2011-11-09 09:20:18.879 Transfer Protocol: FTP
. 2011-11-09 09:20:18.879 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2011-11-09 09:20:18.879 Proxy: SOCKS5
. 2011-11-09 09:20:18.879 HostName: 10.0.2.2 (Port: 5555); Username: ***; Passwd: Yes
. 2011-11-09 09:20:18.879 FTP: FTPS: Explicit SSL; Passive: Yes [Force IP: No]
. 2011-11-09 09:20:18.879 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2011-11-09 09:20:18.879 Cache directory changes: Yes, Permanent: Yes
. 2011-11-09 09:20:18.879 DST mode: 1
. 2011-11-09 09:20:18.879 —————————————————————————
. 2011-11-09 09:20:18.956 Connecting to ftp.*** …
. 2011-11-09 09:20:18.956 m_pProxyLayer changed state from 0 to 1
. 2011-11-09 09:20:18.956 m_pSslLayer changed state from 0 to 1
. 2011-11-09 09:20:18.956 m_pProxyLayer changed state from 1 to 2
. 2011-11-09 09:20:18.956 m_pSslLayer changed state from 1 to 2
. 2011-11-09 09:20:18.956 m_pProxyLayer changed state from 2 to 4
. 2011-11-09 09:20:18.973 m_pSslLayer changed state from 2 to 4
. 2011-11-09 09:20:18.975 Connected with ftp.***, negotiating SSL connection…
< 2011-11-09 09:20:19.031 220 ProFTPD 1.3.3e Server (ProFTPD) [***]
> 2011-11-09 09:20:19.032 AUTH SSL
< 2011-11-09 09:20:19.071 234 AUTH SSL successful
. 2011-11-09 09:20:19.114 SSL_connect: SSLv3 read server hello A
. 2011-11-09 09:20:19.114 SSL_connect: SSLv3 read server certificate A
. 2011-11-09 09:20:19.260 SSL_connect: SSLv3 read server key exchange A
. 2011-11-09 09:20:19.261 SSL_connect: SSLv3 read server certificate request A
. 2011-11-09 09:20:19.261 SSL_connect: SSLv3 read server done A
. 2011-11-09 09:20:19.261 SSL_connect: SSLv3 write client certificate A
. 2011-11-09 09:20:19.261 SSL_connect: SSLv3 write client key exchange A
. 2011-11-09 09:20:19.261 SSL_connect: SSLv3 write change cipher spec A
. 2011-11-09 09:20:19.261 SSL_connect: SSLv3 write finished A
. 2011-11-09 09:20:19.261 SSL_connect: SSLv3 flush data
. 2011-11-09 09:20:19.293 SSL_connect: SSLv3 read finished A
. 2011-11-09 09:20:19.299 Using TLSv1, cipher TLSv1/SSLv3: DHE-RSA-AES256-SHA, 1024 bit RSA
. 2011-11-09 09:20:19.307 SSL connection established. Waiting for welcome message…
> 2011-11-09 09:20:19.307 USER ***
< 2011-11-09 09:20:19.333 331 Password required for ***
> 2011-11-09 09:20:19.333 PASS *************
< 2011-11-09 09:20:19.393 230 User *** logged in
> 2011-11-09 09:20:19.393 SYST
< 2011-11-09 09:20:19.424 215 UNIX Type: L8
> 2011-11-09 09:20:19.427 FEAT
< 2011-11-09 09:20:19.450 211-Features:
< 2011-11-09 09:20:19.450 MDTM
< 2011-11-09 09:20:19.450 MFMT
< 2011-11-09 09:20:19.450 TVFS
< 2011-11-09 09:20:19.450 UTF8
< 2011-11-09 09:20:19.450 AUTH TLS
< 2011-11-09 09:20:19.450 MFF modify;UNIX.group;UNIX.mode;
< 2011-11-09 09:20:19.450 MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
< 2011-11-09 09:20:19.450 LANG en-US*
< 2011-11-09 09:20:19.450 PBSZ
< 2011-11-09 09:20:19.450 PROT
< 2011-11-09 09:20:19.450 REST STREAM
< 2011-11-09 09:20:19.450 SIZE
< 2011-11-09 09:20:19.454 211 End
> 2011-11-09 09:20:19.454 OPTS UTF8 ON
< 2011-11-09 09:20:19.475 200 UTF8 set to on
> 2011-11-09 09:20:19.475 PBSZ 0
< 2011-11-09 09:20:19.507 200 PBSZ 0 successful
> 2011-11-09 09:20:19.507 PROT P
< 2011-11-09 09:20:19.520 200 Protection set to Private
. 2011-11-09 09:20:19.524 Connected
. 2011-11-09 09:20:19.524 Got reply 1 to the command 1
. 2011-11-09 09:20:19.524 —————————————————————————
. 2011-11-09 09:20:19.524 Using FTP protocol.
. 2011-11-09 09:20:19.527 Doing startup conversation with host.
> 2011-11-09 09:20:19.543 PWD
< 2011-11-09 09:20:19.565 257 «/» is the current directory
. 2011-11-09 09:20:19.565 Got reply 1 to the command 16
. 2011-11-09 09:20:19.581 Getting current directory name.
. 2011-11-09 09:20:19.589 Retrieving directory listing…
> 2011-11-09 09:20:19.589 TYPE A
< 2011-11-09 09:20:19.615 200 Type set to A
> 2011-11-09 09:20:19.615 PASV
. 2011-11-09 09:20:19.615 m_pProxyLayer changed state from 0 to 1
< 2011-11-09 09:20:19.639 227 Entering Passive Mode (***).
> 2011-11-09 09:20:19.639 LIST -a
. 2011-11-09 09:20:19.639 m_pProxyLayer changed state from 1 to 2
. 2011-11-09 09:20:19.639 m_pProxyLayer changed state from 2 to 4
. 2011-11-09 09:20:34.213 Timeout detected.
. 2011-11-09 09:20:34.214 Could not retrieve directory listing
. 2011-11-09 09:20:34.214 Got reply 1004 to the command 2
* 2011-11-09 09:20:34.223 (ESshFatal) Lost connection.
* 2011-11-09 09:20:34.223 Timeout detected.
* 2011-11-09 09:20:34.223 Could not retrieve directory listing
* 2011-11-09 09:20:34.223 Entering Passive Mode (***).
* 2011-11-09 09:20:34.223 Error listing directory ‘/’.
LOG(With «Force IP address (…)»)
. 2011-11-09 09:23:41.869 —————————————————————————
. 2011-11-09 09:23:41.873 WinSCP Version 4.3.2 (Build 1201) (OS 6.1.7601 Service Pack 1)
. 2011-11-09 09:23:41.873 Login time: Mittwoch, 9. November 2011 09:23:41
. 2011-11-09 09:23:41.873 —————————————————————————
. 2011-11-09 09:23:41.873 Session name: ***
. 2011-11-09 09:23:41.873 Host name: ftp.*** (Port: 21)
. 2011-11-09 09:23:41.873 User name: *** (Password: Yes, Key file: No)
. 2011-11-09 09:23:41.873 Tunnel: No
. 2011-11-09 09:23:41.873 Transfer Protocol: FTP
. 2011-11-09 09:23:41.873 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2011-11-09 09:23:41.873 Proxy: SOCKS5
. 2011-11-09 09:23:41.874 HostName: 10.0.2.2 (Port: 5555); Username: ***; Passwd: Yes
. 2011-11-09 09:23:41.874 FTP: FTPS: Explicit SSL; Passive: Yes [Force IP: Yes]
. 2011-11-09 09:23:41.874 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2011-11-09 09:23:41.874 Cache directory changes: Yes, Permanent: Yes
. 2011-11-09 09:23:41.874 DST mode: 1
. 2011-11-09 09:23:41.874 —————————————————————————
. 2011-11-09 09:23:41.907 Connecting to ftp.*** …
. 2011-11-09 09:23:41.919 m_pProxyLayer changed state from 0 to 1
. 2011-11-09 09:23:41.919 m_pSslLayer changed state from 0 to 1
. 2011-11-09 09:23:41.919 m_pProxyLayer changed state from 1 to 2
. 2011-11-09 09:23:41.920 m_pSslLayer changed state from 1 to 2
. 2011-11-09 09:23:41.921 m_pProxyLayer changed state from 2 to 4
. 2011-11-09 09:23:41.945 m_pSslLayer changed state from 2 to 4
. 2011-11-09 09:23:41.961 Connected with ftp.***, negotiating SSL connection…
< 2011-11-09 09:23:42.028 220 ProFTPD 1.3.3e Server (ProFTPD) [***]
> 2011-11-09 09:23:42.028 AUTH SSL
< 2011-11-09 09:23:42.081 234 AUTH SSL successful
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 read server hello A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 read server certificate A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 read server key exchange A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 read server certificate request A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 read server done A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 write client certificate A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 write client key exchange A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 write change cipher spec A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 write finished A
. 2011-11-09 09:23:42.234 SSL_connect: SSLv3 flush data
. 2011-11-09 09:23:42.271 SSL_connect: SSLv3 read finished A
. 2011-11-09 09:23:42.281 Using TLSv1, cipher TLSv1/SSLv3: DHE-RSA-AES256-SHA, 1024 bit RSA
. 2011-11-09 09:23:42.286 SSL connection established. Waiting for welcome message…
> 2011-11-09 09:23:42.286 USER ***
< 2011-11-09 09:23:42.514 331 Password required for ***
> 2011-11-09 09:23:42.514 PASS *************
< 2011-11-09 09:23:42.592 230 User *** logged in
> 2011-11-09 09:23:42.592 SYST
< 2011-11-09 09:23:42.629 215 UNIX Type: L8
> 2011-11-09 09:23:42.629 FEAT
< 2011-11-09 09:23:42.657 211-Features:
< 2011-11-09 09:23:42.658 MDTM
< 2011-11-09 09:23:42.658 MFMT
< 2011-11-09 09:23:42.658 TVFS
< 2011-11-09 09:23:42.658 UTF8
< 2011-11-09 09:23:42.658 AUTH TLS
< 2011-11-09 09:23:42.658 MFF modify;UNIX.group;UNIX.mode;
< 2011-11-09 09:23:42.658 MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
< 2011-11-09 09:23:42.658 LANG en-US*
< 2011-11-09 09:23:42.658 PBSZ
< 2011-11-09 09:23:42.658 PROT
< 2011-11-09 09:23:42.658 REST STREAM
< 2011-11-09 09:23:42.658 SIZE
< 2011-11-09 09:23:42.658 211 End
> 2011-11-09 09:23:42.658 OPTS UTF8 ON
< 2011-11-09 09:23:42.690 200 UTF8 set to on
> 2011-11-09 09:23:42.690 PBSZ 0
< 2011-11-09 09:23:42.716 200 PBSZ 0 successful
> 2011-11-09 09:23:42.716 PROT P
< 2011-11-09 09:23:42.741 200 Protection set to Private
. 2011-11-09 09:23:42.742 Connected
. 2011-11-09 09:23:42.743 Got reply 1 to the command 1
. 2011-11-09 09:23:42.743 —————————————————————————
. 2011-11-09 09:23:42.743 Using FTP protocol.
. 2011-11-09 09:23:42.747 Doing startup conversation with host.
> 2011-11-09 09:23:42.754 PWD
< 2011-11-09 09:23:42.788 257 «/» is the current directory
. 2011-11-09 09:23:42.788 Got reply 1 to the command 16
. 2011-11-09 09:23:42.789 Getting current directory name.
. 2011-11-09 09:23:42.801 Retrieving directory listing…
> 2011-11-09 09:23:42.801 TYPE A
< 2011-11-09 09:23:42.826 200 Type set to A
> 2011-11-09 09:23:42.826 PASV
. 2011-11-09 09:23:42.826 m_pProxyLayer changed state from 0 to 1
< 2011-11-09 09:23:42.855 227 Entering Passive Mode (***).
. 2011-11-09 09:23:42.855 GetPeerName failed
. 2011-11-09 09:23:42.855 Could not retrieve directory listing
. 2011-11-09 09:23:42.855 Got reply 4 to the command 2
. 2011-11-09 09:23:42.865 Retrieving directory listing…
> 2011-11-09 09:23:42.865 TYPE A
< 2011-11-09 09:23:42.885 200 Type set to A
> 2011-11-09 09:23:42.885 PASV
. 2011-11-09 09:23:42.885 m_pProxyLayer changed state from 0 to 1
< 2011-11-09 09:23:42.923 227 Entering Passive Mode (***).
. 2011-11-09 09:23:42.923 GetPeerName failed
. 2011-11-09 09:23:42.924 Could not retrieve directory listing
. 2011-11-09 09:23:42.924 Got reply 4 to the command 2
* 2011-11-09 09:23:42.924 (ECommand) Error listing directory ‘/’.
* 2011-11-09 09:23:42.924 GetPeerName failed
* 2011-11-09 09:23:42.924 Could not retrieve directory listing
* 2011-11-09 09:23:42.924 Entering Passive Mode (***).
. 2011-11-09 09:23:43.002 Session upkeep
. 2011-11-09 09:23:43.051 Session upkeep
. 2011-11-09 09:23:43.494 Session upkeep
. 2011-11-09 09:23:43.745 Startup conversation with host finished.
. 2011-11-09 09:23:43.801 Session upkeep
. 2011-11-09 09:23:43.976 Session upkeep
. 2011-11-09 09:23:44.475 Session upkeep
. 2011-11-09 09:23:44.973 Session upkeep
. 2011-11-09 09:23:45.460 Session upkeep
. 2011-11-09 09:23:45.951 Session upkeep
. 2011-11-09 09:23:46.448 Session upkeep
. 2011-11-09 09:23:46.940 Session upkeep
. 2011-11-09 09:23:47.420 Session upkeep
. 2011-11-09 09:23:47.915 Session upkeep
. 2011-11-09 09:23:48.402 Session upkeep
. 2011-11-09 09:23:48.892 Session upkeep
. 2011-11-09 09:23:49.389 Session upkeep
. 2011-11-09 09:23:49.873 Session upkeep
. 2011-11-09 09:23:50.361 Session upkeep
. 2011-11-09 09:23:50.854 Session upkeep
. 2011-11-09 09:23:51.347 Session upkeep
. 2011-11-09 09:23:51.837 Session upkeep
. 2011-11-09 09:23:52.344 Session upkeep
. 2011-11-09 09:23:52.837 Session upkeep
. 2011-11-09 09:23:53.333 Session upkeep
. 2011-11-09 09:23:53.874 Session upkeep
. 2011-11-09 09:23:54.414 Session upkeep
. 2011-11-09 09:23:54.950 Session upkeep
. 2011-11-09 09:23:55.486 Session upkeep
. 2011-11-09 09:23:56.026 Session upkeep
. 2011-11-09 09:23:56.562 Session upkeep
. 2011-11-09 09:23:57.105 Session upkeep
. 2011-11-09 09:23:57.643 Session upkeep
. 2011-11-09 09:23:58.184 Session upkeep
. 2011-11-09 09:23:58.719 Session upkeep
. 2011-11-09 09:23:59.283 Session upkeep
. 2011-11-09 09:23:59.831 Session upkeep
. 2011-11-09 09:24:00.368 Session upkeep
. 2011-11-09 09:24:00.903 Session upkeep
. 2011-11-09 09:24:01.469 Session upkeep
. 2011-11-09 09:24:01.977 Session upkeep
. 2011-11-09 09:24:02.529 Session upkeep
. 2011-11-09 09:23:43.798 Disconnected from server
Do you have any idea why this happens?
Thanks!
Reply with quote
-
martin◆
Site Admin -
- Joined:
- 2002-12-10
- Posts:
- 38,466
- Location:
- Prague, Czechia
2011-11-11
pe wrote:
I have a similiar problem: initial directory listing after having connected over FTPS fails.
WinSCP runs in a Win7 VM on a Linux host. I’m behind a firewall. Therefore the host system tunnels traffic over SSH offering a local SOCKS5 proxy. WinSCP in the VM uses this proxy. FTP without SSL encryption works fine…
Are you able to do this with any other FTP client?
Reply with quote
-
newGuest01
Guest
2012-03-12 20:36
Nettie wrote:
Those who say they cannot activate passive mode need to EDIT their already saved session. Or delete and create a new one if that is easier.
As stated in post above I was unable to access passive mode (grayed out) then after reading a previous post it explained to edit. Before this I was turning off my firewall and that worked. But choose passive mode instead.
Also these post really help so thank you.
None of the stuff on here worked in my case. I even downloaded the latest version of winscp with «passive» mode already checked. It only worked after I gave world execute permission on the directory. This sounds like a bug to me!
Reply with quote
-
martin◆
Site Admin -
- Joined:
- 2002-12-10
- Posts:
- 38,466
- Location:
- Prague, Czechia
2012-03-15
newGuest01 wrote:
None of the stuff on here worked in my case. I even downloaded the latest version of winscp with «passive» mode already checked. It only worked after I gave world execute permission on the directory. This sounds like a bug to me!
Please post a full log file showing the problem. Start a new topic for that.
To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
Reply with quote
Advertisement
-
natasha
Guest
2012-07-11 19:52
Can anyone tell me how to use Winscp as Ftp server???
Really urgent
Reply with quote
-
martin◆
Site Admin -
- Joined:
- 2002-12-10
- Posts:
- 38,466
- Location:
- Prague, Czechia
2012-07-12
natasha wrote:
Can anyone tell me how to use Winscp as Ftp server???
Really urgent
WinSCP is not FTP server.
Reply with quote
- sago
- Joined:
- 2012-10-18
- Posts:
- 2
- Location:
- Ukraine
2012-10-18 07:59
Hi! After updating version 8,3,7 up to 5.1.0 gives out:
Error retrieving server address
Could not retrieve directory listing
Unable to build data connection: Operation not permitted
Thanks a lot!
Reply with quote
-
martin◆
Site Admin -
- Joined:
- 2002-12-10
- Posts:
- 38,466
- Location:
- Prague, Czechia
2012-10-18
sago wrote:
Hi! After updating version 8,3,7 up to 5.1.0 gives out:
Error retrieving server address
Could not retrieve directory listing
Unable to build data connection: Operation not permitted
Please attach a full log file showing the problem. Start a new thread for that.
To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
Reply with quote
Advertisement
- Guest
2012-10-18 14:06
martin wrote:
sago wrote:
Hi! After updating version 8,3,7 up to 5.1.0 gives out:
Error retrieving server address
Could not retrieve directory listing
Unable to build data connection: Operation not permittedPlease attach a full log file showing the problem. Start a new thread for that.
To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
ok!
Reply with quote
-
martin◆
Site Admin -
2012-10-22
Thanks. Can you please also post a log file from 4.3.7?
Reply with quote
- sago
- Joined:
- 2012-10-18
- Posts:
- 2
- Location:
- Ukraine
2012-10-22 12:33
martin wrote:
Thanks. Can you please also post a log file from 4.3.7?
ok!
Reply with quote
-
martin◆
Site Admin -
2012-10-27
Thanks for your report.
I have sent you an email with a development version of WinSCP to address you have used to register on this forum.
Reply with quote
Advertisement
-
Piote
Guest
2014-09-09 09:01
Hi.
In my case what helped was selecting «Use MLSD command for directory listing» from Auto to Off in FTP settings
Regards
Reply with quote
-
martin◆
Site Admin -
2014-09-09
Piote wrote:
In my case what helped was selecting «Use MLSD command for directory listing» from Auto to Off in FTP settings
Thanks for sharing your solution. Though, I would still like to see your session log file (in Auto
mode).
Reply with quote
-
Ashish01july
Guest
2016-09-06 15:31
Hi ,I am facing this issue Directory Retrieval listing error.
Reply with quote
-
martin◆
Site Admin -
2016-09-08
Ashish01july wrote:
Hi ,I am facing this issue Directory Retrieval listing error.
So start a new thread for your problem and attach a session log file and include all details you can.
Reply with quote
Advertisement
-
user_zzz
Guest
2017-02-15 16:58
This thread went on for years…..and has yet to be resolved.
I encounter this error when connecting to external hosts from within my proxy.
Outside the proxy it works fine. Our proxy techs cannot point to a cause.
How can this issue have gone unresolved for 5 years????
What is the ANSWER?
I have tried every solution presented here to no avail.
I’m running v5.5.4 build 4433.
Why are you suggesting starting another thread for the SAME issue? The original issue hasn’t been resolved.
All help appreciated.
Reply with quote
-
martin◆
Site Admin -
- Joined:
- 2002-12-10
- Posts:
- 38,466
- Location:
- Prague, Czechia
2017-02-16
user_zzz wrote:
This thread went on for years…..and has yet to be resolved.
I encounter this error when connecting to external hosts from within my proxy.
Outside the proxy it works fine. Our proxy techs cannot point to a cause.
How can this issue have gone unresolved for 5 years????What is the ANSWER?
I have tried every solution presented here to no avail.
I’m running v5.5.4 build 4433.
Why are you suggesting starting another thread for the SAME issue? The original issue hasn’t been resolved.
All help appreciated.
— You are using three years old version. Upgrade first.
— You didn’t tell us, if you can connect with any other FTP client.
— You didn’t post a log file.
— This threads covers many different problems. That’s why I want people to start a new thread. Because it’s useless, if they come here, saying «I have the same problem». Because they don’t.
Reply with quote
Advertisement
- Reply to topic
- Log in
You can post new topics in this forum
Are you getting an error like “FTP cannot retrieve directory listing” when you try to access FTP server remotely?
This error is caused due to the bad settings in the FTP server, misconfiguration of FTP client, when passive mode setting disables and much more.
That’s why we often get requests from our customers to solve the error like “FTP cannot retrieve directory listing” as part of our Server Management Services.
Today, we’ll see how our Support Engineers fixed the issue for our customers.
What is “FTP cannot retrieve directory listing” error?
This error “FTP cannot retrieve directory listing” means that the user could not access the files from FTP server.
Users encounter an error message like this.
Error: Failed to retrieve directory listing
Now, let’s see the reasons for the error and the real solution to fix it.
Top 4 reasons and solutions to fix it
Here, we have the top 4 reasons for this error to occur and how we troubleshoot it.
1. Wrong encryption settings in FTP client
For instance, in FileZilla, when you connect to FTP server, you will see something like this.
Response: 227 Entering Passive Mode (11,22,33,44,167,111)
Command: MLSD
Error: Connection timed out
Error: Failed to retrieve directory listing
This happens when encryption is set to “Use explicit FTP over TLS if available” in FTP client settings.
So, we changed the encryption to “only use plain FTP” by executing the below steps.
1. First, we click on the File menu and choose Site Manager.
2. Then add Host and change Encryption to only use plain FTP.
3. Also, change the Logon Type to Normal and enter Username and Password.
4. Finally, click Connect to continue.
2. Problem with Passive mode
FTP operates in both active and passive mode. By default, FTP clients like FileZilla, CuteFTP uses passive as transfer mode.
But, in some cases, you may get an error like “FTP cannot retrieve directory listing” in passive mode. Then, try to change the default transfer mode by simply doing the steps below.
1. Go to Settings > Edit and click on Connection > FTP and choose Active.
2. Then under Active mode IP > select Ask your operating system for the external IP address.
3. Finally, under Passive mode > choose Fall back to active mode and click ok to save.
3. Missing passive port range in FTP server
In most of the cases “FTP cannot retrieve directory listing” error happens when passive port range is not mentioned FTP server configuration.
In cPanel for FTP servers like PureFTP, we perform the following steps.
1. We log in to the server via SSH.
2. Open the /var/cpanel/conf/pureftpd/local file and we add the entry like:
ForcePassiveIP: X.X.X.X
We add these changes to the file because FTP server exists behind the firewall.
3. Then we change the server’s default passive port range, by running the command.
echo "PassivePortRange: 49152 65534" >> /var/cpanel/conf/pureftpd/local
/usr/local/cpanel/scripts/setupftpserver pure-ftpd --force
4. Next, we configure the server to allow the passive port range to pass through the firewall.
5. Finally, restart the PureFTP service.
/usr/local/cpanel/scripts/setupftpserver pure-ftpd --force
4. Lacking Port range in firewall settings
Often this error happens when a firewall blocks passive FTP ports. So, it results in getting an error like “FTP cannot retrieve directory listing”.
We execute the following steps to add the passive port range to the firewall.
1. For firewall like iptables, we open the /etc/sysconfig/iptables file in a text editor.
2. Then add the entry like:
iptables -I INPUT -p tcp --dport 49152:65534 -j ACCEPT
3. Finally, run the command to save.
service iptables save
This is how we fix the error like “FTP cannot retrieve directory listing”.
[Having trouble in “FTP cannot retrieve directory listing” error? We’ll fix it for you.]
Conclusion
In short, “FTP cannot retrieve directory listing” error can happen due to a misconfiguration in firewall settings, incorrect passive port range, and more. Today, we’ve discussed the top 4 reasons for this error and how our Technical Engineers fixed them.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
var google_conversion_label = «owonCMyG5nEQ0aD71QM»;
I’m running a FreeDos v1.1 VirtualBox guest on a Windows 7 64-bit host. Today I ran mTCP’s ftpsrv.exe for FTP access and FTP’d into FreeDos using WinSCP. It started me in my last accessed directory, which was /DRIVE_C/RR2
. I browsed to the root directory (/DRIVE_C
) and uploaded a small file. After the file transfer completed, WinSCP hanged on the file transfer before telling me the connection was broken and that it failed to retrieve the directory listing:
Timeout detected. (data connection)
Could not retrieve directory listing
Error listing directory ‘/DRIVE_C’.
Initially I thought there had been a disk error, but the file was successfully uploaded and everything else seemed to be in order.
Trying to reconnect, however, results in the same error. Clearing the remote directory setting from WinSCP solves nothing. I created a new user and logging in that way still received the same error.
What I can do is manually specify the starting directory to almost any subdirectory other than /DRIVE_C
or /DRIVE_C/FDOS
. Directories are randomly «not found,» causing WinSCP to disconnect, and WinSCP will randomly choke and disconnect while transferring files. Sometimes I can copy a file in FreeDOS to a different location then download it via FTP, but sometimes not. Uploading a file will usually render its directory invisible to FTP.
The VM has a 2GB disk and is half empty, so the disk isn’t low on space.
After wasting hours trying to troubleshoot this, I finally said «screw it» and installed a FreeDOS 1.2 VM guest. I downloaded as many games files as I could from my FreeDos 1.1 VM, then started uploading them to my new FreeDOS 1.2 VM. I decided to put the game files under /DRIVE_C/GAMES/
and drag-n-dropped them from my host to the guest via WinSCP. WinSCP timed out and resumed a few times before choking on a directory listing error and then quitting with an «abnormal execution» error. I can no longer access /DRIVE_C/GAMES/
via FTP (but have no problem when working directly on the system).
Here’s my ftpsrv user setup on both FreeDOS VMs:
# userid password sandbox_directory incoming_directory permissions
redacted redacted [none] [any] all
According to this, my login should have full access with no restrictions.
mTCP configuration on FreeDOS 1.1 (mostly default settings)
packetint 0x60
mtu 1472
DOSRules
ftpsrv_password_file c:FDOSftppass.txt
ftpsrv_log_file c:FDOSftpsrv.log
ftpsrv_filebuffer_size 16
ftpsrv_tcpbuffer_size 16
ftpsrv_packets_per_roll 2
mTCP configuration on FreeDOS 1.2 (mostly default settings)
packetint 0x60
mtu 1500
DOSRules
ftpsrv_password_file c:FDOSftppass.txt
ftpsrv_log_file c:FDOSftpsrv.log
# I forgot to uncomment these, but seems to have made no difference
#ftpsrv_filebuffer_size 16
#ftpsrv_tcpbuffer_size 16
#ftpsrv_packets_per_roll 2
I somehow doubt WinSCP is the culprit here, even though interacting with mTCP seems to be making it wonky. I use WinSCP nearly every day to connect to other systems, and I’ve never encountered this kind of behavior.
WinSCP configuration for both connections:
Protocol: FTP
Encryption: No encryption
Port number: 21
UTF-8 encoding for filenames: Auto
[ ] Trim VMS version numbers
[ ] Synchronize browsing
[x] Remember last used directory
(turning this off didn’t help)
[x] Cache visited remote directories
[x] Cache directory changes
[x] Permanent cache
[x] Resolve symbolic links
[ ] Follow symbolic links to directories
[ ] Preserve deleted files to recycle bin
[x] Passive mode
Protocal options: All auto
Server response timeout: 15
Keepalives: Executing dummy protocol commands
Seconds between keepalives: 30
Internet protocol version: Auto
Proxy type: None
I’m inclined to believe the fault lies in an OS permission setting. I can however find no documentation about file permissions in FreeDos. The closest I can find is attributes, which gives me the following information (on FreeDOS 1.1):
[D----] FDOS
[----A] KERNAL.SYS
[----A] AUTOEXEC.BAT
[----A] COMMAND.COM
[----A] FDCONFIG.SYS
[----A] BOOTSECT.BIN
[D----] DUKE3D
[D----] RR2
which clearly have nothing to do with permissions.
Update 2017.04.03: As requested, here are my log files. (WinSCP wasn’t logging, so this is from this morning.)
Log file from WinSCP:
. 2017-04-03 10:22:22.641 --------------------------------------------------------------------------
. 2017-04-03 10:22:22.642 WinSCP Version 5.9.4 (Build 7333) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
. 2017-04-03 10:22:22.643 Configuration: C:UsersRedactedAppDataRoamingwinscp.ini
. 2017-04-03 10:22:22.643 Log level: Normal
. 2017-04-03 10:22:22.643 Local account: Redacted
. 2017-04-03 10:22:22.644 Working directory: C:UsersRedacted
. 2017-04-03 10:22:22.644 Process ID: 7508
. 2017-04-03 10:22:22.644 Command-line: "C:Windowswinscp.exe"
. 2017-04-03 10:22:22.644 Time zone: Current: GMT-6, Standard: GMT-7 (Mountain Standard Time), DST: GMT-6 (Mountain Daylight Time), DST Start: 3/12/2017, DST End: 11/5/2017
. 2017-04-03 10:22:22.644 Login time: Monday, April 03, 2017 10:22:22 AM
. 2017-04-03 10:22:22.644 --------------------------------------------------------------------------
. 2017-04-03 10:22:22.644 Session name: FreeDos 1.1 (Modified site)
. 2017-04-03 10:22:22.644 Host name: 192.168.1.123 (Port: 21)
. 2017-04-03 10:22:22.644 User name: redacted (Password: No, Key file: No, Passphrase: No)
. 2017-04-03 10:22:22.644 Transfer Protocol: FTP
. 2017-04-03 10:22:22.644 Ping type: Dummy, Ping interval: 30 sec; Timeout: 5 sec
. 2017-04-03 10:22:22.644 Disable Nagle: No
. 2017-04-03 10:22:22.644 Proxy: None
. 2017-04-03 10:22:22.644 Send buffer: 262144
. 2017-04-03 10:22:22.644 UTF: Auto
. 2017-04-03 10:22:22.644 FTPS: None [Client certificate: No]
. 2017-04-03 10:22:22.645 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2017-04-03 10:22:22.645 Local directory: C:TEMPFdDOS, Remote directory: /DRIVE_C/UP, Update: Yes, Cache: Yes
. 2017-04-03 10:22:22.645 Cache directory changes: Yes, Permanent: Yes
. 2017-04-03 10:22:22.645 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2017-04-03 10:22:22.645 Timezone offset: 0h 0m
. 2017-04-03 10:22:22.645 --------------------------------------------------------------------------
. 2017-04-03 10:22:22.774 Connecting to 192.168.1.123 ...
. 2017-04-03 10:22:22.774 Connected with 192.168.1.123. Waiting for welcome message...
< 2017-04-03 10:22:22.774 220 mTCP FTP Server
> 2017-04-03 10:22:22.774 USER redacted
< 2017-04-03 10:22:22.775 331 User OK, send Password
> 2017-04-03 10:22:26.075 PASS ********
< 2017-04-03 10:22:26.281 230 User logged in
> 2017-04-03 10:22:26.281 SYST
< 2017-04-03 10:22:26.281 215 UNIX Type: L8
> 2017-04-03 10:22:26.281 FEAT
< 2017-04-03 10:22:26.282 211-mTCP FTP server features:
< 2017-04-03 10:22:26.282 MDTM
< 2017-04-03 10:22:26.282 211 End
. 2017-04-03 10:22:26.327 Connected
. 2017-04-03 10:22:26.327 --------------------------------------------------------------------------
. 2017-04-03 10:22:26.327 Using FTP protocol.
. 2017-04-03 10:22:26.329 Doing startup conversation with host.
> 2017-04-03 10:22:26.379 PWD
< 2017-04-03 10:22:26.380 257 "/" is current directory
. 2017-04-03 10:22:26.380 Changing directory to "/DRIVE_C/UP".
> 2017-04-03 10:22:26.380 CWD /DRIVE_C/UP
< 2017-04-03 10:22:26.381 250 CWD command successful
. 2017-04-03 10:22:26.381 Getting current directory name.
> 2017-04-03 10:22:26.381 PWD
< 2017-04-03 10:22:26.381 257 "/DRIVE_C/UP/" is current directory
. 2017-04-03 10:22:26.581 Retrieving directory listing...
> 2017-04-03 10:22:26.581 TYPE A
< 2017-04-03 10:22:26.581 200 Type set to A
> 2017-04-03 10:22:26.582 PASV
< 2017-04-03 10:22:26.582 227 Entering Passive Mode (192,168,1,123,8,42)
> 2017-04-03 10:22:26.582 LIST -a
. 2017-04-03 10:22:26.582 Connecting to 192.168.1.123:2090 ...
< 2017-04-03 10:22:26.583 150 Sending file list
. 2017-04-03 10:22:26.583 Data connection closed
. 2017-04-03 10:22:26.583 <Empty directory listing>
< 2017-04-03 10:22:26.584 226 Transfer complete
. 2017-04-03 10:22:26.584 Directory listing successful
. 2017-04-03 10:22:26.584 LIST with -a switch returned empty directory listing, will try pure LIST
. 2017-04-03 10:22:26.584 Retrieving directory listing...
> 2017-04-03 10:22:26.584 TYPE A
< 2017-04-03 10:22:26.584 200 Type set to A
> 2017-04-03 10:22:26.585 PASV
< 2017-04-03 10:22:26.585 227 Entering Passive Mode (192,168,1,123,8,91)
> 2017-04-03 10:22:26.585 LIST
. 2017-04-03 10:22:26.585 Connecting to 192.168.1.123:2139 ...
< 2017-04-03 10:22:26.586 150 Sending file list
. 2017-04-03 10:22:26.586 Data connection closed
. 2017-04-03 10:22:26.586 <Empty directory listing>
< 2017-04-03 10:22:26.586 226 Transfer complete
. 2017-04-03 10:22:26.586 Directory listing successful
. 2017-04-03 10:22:26.587 ..;D;0;1899-12-30T07:00:00.000Z;0;"" [0];"" [0];---------;0
. 2017-04-03 10:22:26.681 Startup conversation with host finished.
. 2017-04-03 10:22:30.251 Cached directory change via ".." to "/DRIVE_C".
. 2017-04-03 10:22:30.251 Getting current directory name.
. 2017-04-03 10:22:30.254 Retrieving directory listing...
> 2017-04-03 10:22:30.254 CWD /DRIVE_C/
< 2017-04-03 10:22:30.254 250 CWD command successful
> 2017-04-03 10:22:30.254 PWD
< 2017-04-03 10:22:30.254 257 "/DRIVE_C/" is current directory
> 2017-04-03 10:22:30.254 TYPE A
< 2017-04-03 10:22:30.254 200 Type set to A
> 2017-04-03 10:22:30.254 PASV
< 2017-04-03 10:22:30.254 227 Entering Passive Mode (192,168,1,123,11,61)
> 2017-04-03 10:22:30.254 LIST
. 2017-04-03 10:22:30.254 Connecting to 192.168.1.123:2877 ...
< 2017-04-03 10:22:30.256 150 Sending file list
. 2017-04-03 10:22:30.256 Data connection closed
< 2017-04-03 10:22:30.256 226 Transfer complete
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Jul 14 2016 FDOS
. 2017-04-03 10:22:30.256 -rwxrwxrwx 1 ftp ftp 45344 Jun 21 2011 KERNEL.SYS
. 2017-04-03 10:22:30.256 -rwxrwxrwx 1 ftp ftp 1266 Apr 2 06:26 AUTOEXEC.BAT
. 2017-04-03 10:22:30.256 -rwxrwxrwx 1 ftp ftp 66945 Aug 28 2006 COMMAND.COM
. 2017-04-03 10:22:30.256 -rwxrwxrwx 1 ftp ftp 848 Jul 14 2016 FDCONFIG.SYS
. 2017-04-03 10:22:30.256 -rwxrwxrwx 1 ftp ftp 512 Jul 14 2016 BOOTSECT.BIN
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Jul 14 2016 RR
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Jul 14 2016 ATOMIC
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Jul 14 2016 DUKE3D
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Jul 30 2016 RR2
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Aug 9 2016 HUNT
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Apr 2 08:13 TEST
. 2017-04-03 10:22:30.256 -rwxrwxrwx 1 ftp ftp 527 Apr 2 07:09 README.TXT
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Apr 2 18:23 DCINST
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Apr 2 18:26 DUKEDC
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Apr 2 18:36 ERR200
. 2017-04-03 10:22:30.256 drwxrwxrwx 1 ftp ftp 0 Apr 2 18:39 UP
. 2017-04-03 10:22:30.256 -rwxrwxrwx 1 ftp ftp 161 Apr 2 18:44 GAMER.INI
. 2017-04-03 10:22:30.266 Directory listing successful
. 2017-04-03 10:22:30.266 ..;D;0;1899-12-30T07:00:00.000Z;0;"" [0];"" [0];---------;0
. 2017-04-03 10:22:30.266 FDOS;D;0;2016-07-14T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.266 KERNEL.SYS;-;45344;2011-06-21T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.266 AUTOEXEC.BAT;-;1266;2017-04-02T12:26:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.266 COMMAND.COM;-;66945;2006-08-28T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.266 FDCONFIG.SYS;-;848;2016-07-14T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.266 BOOTSECT.BIN;-;512;2016-07-14T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 RR;D;0;2016-07-14T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 ATOMIC;D;0;2016-07-14T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 DUKE3D;D;0;2016-07-14T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 RR2;D;0;2016-07-30T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 HUNT;D;0;2016-08-09T06:00:00.000Z;2;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 TEST;D;0;2017-04-02T14:13:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 README.TXT;-;527;2017-04-02T13:09:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 DCINST;D;0;2017-04-03T00:23:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 DUKEDC;D;0;2017-04-03T00:26:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 ERR200;D;0;2017-04-03T00:36:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 UP;D;0;2017-04-03T00:39:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:30.267 GAMER.INI;-;161;2017-04-03T00:44:00.000Z;1;"ftp" [0];"ftp" [0];rwxrwxrwx;1
. 2017-04-03 10:22:34.312 Cached directory change via "FDOS" to "/DRIVE_C/FDOS".
. 2017-04-03 10:22:34.312 Getting current directory name.
. 2017-04-03 10:22:34.316 Retrieving directory listing...
> 2017-04-03 10:22:34.316 CWD /DRIVE_C/FDOS/
< 2017-04-03 10:22:34.317 250 CWD command successful
> 2017-04-03 10:22:34.317 PWD
< 2017-04-03 10:22:34.317 257 "/DRIVE_C/FDOS/" is current directory
> 2017-04-03 10:22:34.317 TYPE A
< 2017-04-03 10:22:34.317 200 Type set to A
> 2017-04-03 10:22:34.317 PASV
< 2017-04-03 10:22:34.317 227 Entering Passive Mode (192,168,1,123,9,182)
> 2017-04-03 10:22:34.317 LIST
. 2017-04-03 10:22:34.317 Connecting to 192.168.1.123:2486 ...
< 2017-04-03 10:22:34.317 150 Sending file list
< 2017-04-03 10:22:34.317 226 Transfer complete
. 2017-04-03 10:22:39.872 Timeout detected. (data connection)
. 2017-04-03 10:22:39.872 Could not retrieve directory listing
. 2017-04-03 10:22:39.872 Connection was lost, asking what to do.
. 2017-04-03 10:22:39.872 Asking user:
. 2017-04-03 10:22:39.872 Lost connection. ("Timeout detected. (data connection)","Could not retrieve directory listing")
* 2017-04-03 10:22:41.881 (ESshFatal) **Lost connection.**
* 2017-04-03 10:22:41.881 Timeout detected. (data connection)
* 2017-04-03 10:22:41.881 Could not retrieve directory listing
* 2017-04-03 10:22:41.881 Error listing directory '/DRIVE_C/FDOS'.
* 2017-04-03 10:22:41.881 Error changing directory to 'FDOS'.
Log file from mTCP on FreeDOS 1.1
2017-04-03 10:17:37.40 mTCP FtpSrv version (Oct 29 2011) starting
2017-04-03 10:17:37.40 Clients: 3, Client file buffer size: 16384, TCP buffer size: 16384
2017-04-03 10:17:37.40 Packets per poll: 2, TCP sockets: 10, Send buffers: 15, Recv buffers: 40
2017-04-03 10:17:37.40 Client session timeout: 182 seconds
2017-04-03 10:17:37.40 Control port: 21, Pasv ports: 2048-3071
2017-04-03 10:17:37.46 Real IP address: 192.168.1.123, Pasv response IP addr: 192.168.1.123
2017-04-03 10:17:49.65 (0) User redacted signed in from 192.168.1.147:51304 at 2017-04-03 10:17:44
2017-04-03 10:18:09.31 (0) Disconnect: 192.168.1.147:51304
2017-04-03 10:22:23.84 (1) User redacted signed in from 192.168.1.147:51316 at 2017-04-03 10:22:20
2017-04-03 10:22:37.62 (1) Disconnect: 192.168.1.147:51316
2017-04-03 10:36:36.83 (2) User redacted signed in from 192.168.1.147:51365 at 2017-04-03 10:36:33
2017-04-03 10:36:51.39 (2) Disconnect: 192.168.1.147:51365
2017-04-03 10:36:55.83 Shutdown requested
2017-04-03 10:36:56.88 Stats: Sessions: 3 Timeouts: 0
2017-04-03 10:36:56.88 LIST: 11 NLST: 0 RETR: 0
2017-04-03 10:36:56.88 STOR: 0 STOU: 0 APPE: 0
2017-04-03 10:36:56.88 === Server shutdown ===
Update: I tried with Core FTP, and here’s its log:
Welcome to Core FTP, release ver 2.2, build 1887 (x64) -- © 2003-2016
WinSock 2.0
Mem -- 33,531,236 KB, Virt -- 8,589,934,464 KB
Started on Monday April 03, 2017 at 11:36:AM
Connect socket #752 to 192.168.1.123, port 21...220 mTCP FTP Server
USER redacted
331 User OK, send Password
PASS **********
230 User logged in
SYST
215 UNIX Type: L8
Keep alive off...PWD
257 "/" is current directory
PASV
227 Entering Passive Mode (192,168,1,123,10,76)
LIST
Connect socket #800 to 192.168.1.123, port 2636...150 Sending file list
226 Transfer complete
Transferred 54 bytes in 60.000 seconds
CWD /DRIVE_C
250 CWD command successful
PASV
227 Entering Passive Mode (192,168,1,123,9,147)
LIST
Connect socket #844 to 192.168.1.123, port 2451...150 Sending file list
226 Transfer complete
Transferred 1,028 bytes in 60.001 seconds
CWD /DRIVE_C/FDOS/
250 CWD command successful
PASV
227 Entering Passive Mode (192,168,1,123,8,41)
LIST
Connect socket #960 to 192.168.1.123, port 2089...150 Sending file list
226 Transfer complete
Transferred 1,279 bytes in 0.001 seconds
CDUP
250 CWD command successful
PWD
257 "/DRIVE_C/" is current directory
PASV
227 Entering Passive Mode (192,168,1,123,8,67)
LIST
Connect socket #972 to 192.168.1.123, port 2115...150 Sending file list
226 Transfer complete
Transferred 1,028 bytes in 60.001 seconds
QUIT
221 Server closing connection
Total uploaded files: 0
Total uploaded data: 0
Total downloaded files: 0
Total downloaded data: 0
As you can see, it took just over 60 seconds to retrieve 54 bytes of directory information. Core FTP seems to be more successful, in that it eventually gets the directory listing. Some times it works quickly like you would expect FTP to, like when it transferred 1,279 bytes in 0.001 seconds, but it still seems to be hit and miss.
I thought maybe I just wasn’t letting WinSCP wait long enough, so I increased the timeout to two minutes. The only different behavior was that WinSCP hanged for two full minutes before displaying the error.
The mTCP log from these latest two attempts shows nothing more than «User signed in» and «Disconnect» with 0 timeouts and no errors, just like the full log further up this page.
I started thinking the router might be the issue, so I turned off and back on, but that made no difference. My computer is wired directly to the router by a 3-foot cord, and all other internet usage seems normal, so I’m not likely experiencing network interference.
Maybe its time I file a bug with the developer of mTCP and see what he comes up with.
Something is really not working here. I have the following error in using FileZilla to connect to a remote machine running vsftpd
:
Command: LIST
Error: Connection timed out
Error: Failed to retrieve directory listing
I am trying to set up FTP services on 3 machines behind a residential ISP firewall. All are Ubuntu 12.04 Server LTS, and I am restricted from using port 21 externally at the remote site.
Well.. Ok, I confess, it’s myself who is imposing the restriction. I just wanted to sound like I was working for a real company. Anyway, only 1 of the 3 systems could have been assigned to 21, so it would still be an issue.
I have tried the solutions for adding «pasv_…» lines, but I still cannot get past the LIST stage of connecting.
- https://stackoverflow.com/questions/4723023/vsftpd-error-listing-directories
- http://www.linuxquestions.org/questions/linux-server-73/vsftpd-error-failed-to-retrieve-directory-listing-878838/
- https://serverfault.com/questions/421161/how-to-configure-vsftpd-to-work-with-passive-mode
- http://www.linuxquestions.org/questions/linux-networking-3/vsftpd-cannot-list-files-but-can-change-dirs-519340/
So, having failed that, what might the problem be?
I read on this site that I need to forward ports 20 and 21. Right now the remote sites have ports like 10000, 11000, 12000 forwarded to the internal port 21 on each of the systems. Should I forward some additional ports in to 20? it doesn’t make sense because that port isn’t even open, vsftpd is only listening on 21.
All I want is for a successful ftp connection through these forwarded ports, I am frustrated because I have successfully forwarded for services like SSH, apache2, etc and I don’t get what is broken here.
thx Joren for correcting my formatting!
EDIT: I have been messing around with my testing VPS which is directly exposed to the internet, I installed vsftpd just to see what happens, and the output of ‘netstat -tuna’ shows that a successful connection from my filezilla client looks like this:
tcp 0 0 vps.vps.vps.vps:21 fi.le.zil.la:54288 ESTABLISHED
tcp 0 0 vps.vps.vps.vps:46403 fi.le.zil.la:54289 TIME_WAIT
Note: the FTP server at my VPS also didn’t work at first, due to a completely unrelated issue involving virtualized environments («500 OOPS: priv_sock_get_cmd»). Read: I am starting to see that Ubuntu’s vsftpd doesn’t work ‘out-of-the-box’ like apache2 and sshd do, for any frustrated novice sysadmins out there, don’t think you’re stupid if it isn’t working first thing…
My testing VPS doesn’t have a firewall, so all ports are directly available for access by the FTP daemon. After running this test, I see that it is possible that this secondary connection is being blocked at the remote site where I’m having issues (random ports such as 46403).
At least now I have confirmed that there are no NAT issues with my Filezilla, because clearly filezilla is opening random ports and talking with my VPS ok.
The one thing that makes no sense, is the config ‘connect_from_port_20=YES’ is set on my VPS FTP config, yet I can’t see any connections using port 20!!! This is why I don’t even know if this port needs to be forwarded behind a firewall.
One of my knowledge deficiencies is I don’t even know what port 20 does, and I can’t learn through experience because I’ve never seen any indication the port is ever used duing connecting, downloading or uploading.
OK, I found some problems (there’s clearly more then one thing wrong) — This has to do with port forwarding.
Suspect original problem (before customizing vsftpd.conf)
- Filezilla initially connects to remote port 10000, ==> goes to 21 on internal FTP server (ok)
- FTP server opens a random port (NOT 20) like 45678, but the router obviously doesn’t have a rule for this randomly assigned port. It sends a message telling filezilla to also connect to 45678.
- Filezilla client opens up its own port on my end behind NAT(ok)
- Filezilla sends connection request to 45678, but the remote router doesn’t accept the connection, as there is no forwarding rule for that port.
Now, the problem(s) I created:
pasv_enable=YES
pasv_min_port=10000
pasv_max_port=10000
- Filezilla connects to remote port 10000, ==> goes to 21 on internal FTP server (ok)
- FTP server opens the only port it can, 10000, [stupid moment] because I have that port in my head associated with that system. But 10000 is actually the WAN side counterpart for 21 on this system. Server sends a message for FileZilla to connect to 10000, and listens internally on 10000
- Filezilla client opens up its own random port on my end (ok)
- Filezilla tries the secondary connection at port 10000, the remote router deflects it to port 21 again where it must be ignored or lost, while the FTP server waits for a connection to internal port 10000 that never arrives. (fail)
Second problem I created: I tried to bind port 21 this time, but I think that messed up filezilla.
pasv_enable=YES
pasv_min_port=21
pasv_max_port=21
- Filezilla connects to remote port 10000, ==> goes to 21 on internal FTP server (ok)
- FTP server opens port 21 (or maybe fails because 21 is already used) if it succeeded, it sent a message for filezilla to connect to port 21.
- Filezilla client opens up its own random port on my end (ok)
- Filezilla sends a request for LIST to 21, which the router is not going to accept…(fail)
Conclusion: as long as the port is being changed by a router, the FTP server will never be able to tell the client to connect to the right port. If you try to use the internal port, the client will run up against the router. If you try to specifiy the external port, the router will deflect the incoming connection to a different number — which the server was not expecting.
I will test a solution and report back here with the results.
I think, because the FTP server protocol appears to tell the client which port to connect to, that secondary connection MUST have the same external port number as internal.
I will call this a ‘secondary connection’ and I think it has something to do with the port 20 thing that I don’t understand.
So, I will contact the remote site and have an additional port forwarded directly, so the FTP server can open a connection internally, and the client will be able to send a connection request to that exact port number.
New plan:
(note: the ‘%’ is meant to show the port getting changed by the remote router.)
server #1 primary connection: 21 <--%--> 10000 secondary connection 10001 <-----> 10001 vsftp.conf: pasv_min_port=10001 pasv_max_port=10001 server #2 primary connection 21 <--%--> 11000 secondary connection 11001 <-----> 11001 vsftp.conf: pasv_min_port=11001 pasv_max_port=11001 server #3 primary connection 21 <--%--> 12000 secondary connection 12001 <-----> 12001 vsftp.conf: pasv_min_port=12001 pasv_max_port=12001
Updated January 2023: Stop getting error messages and slow down your system with our optimization tool. Get it now at this link
- Download and install the repair tool here.
- Let it scan your computer.
- The tool will then repair your computer.
You cannot connect via FTP; the server accepts your username and password, but it fails when you request a directory or wait for a welcome message.
An error such as one of the following may appear:
- Unable to build data connection: Connection timed out
- MLSD: Connection timed out
- [R] List Error
- Error: Failed to retrieve directory listing
FileZilla is free software, there are two versions, FileZilla Client and FileZilla Server. The client is supported on all platforms, but the server only supports Windows. This application is used to transfer files between computers on a network. Recently, however, there have been many reports in which users trying to connect to the server have found the error “Failed to Retrieve Directory Listing”.
How to fix directory listing errors that fail in FileZilla FTP?
You can easily solve this problem by going to the Site Manager and adjusting your login data to use simple FTP. Follow these steps to solve the problem:
- In FileZilla, click on the File menu and select Site Manager.
- Add the website or server to which you want to connect, if it is not already present in Site Manager.
- Add a host name
- Change the encryption to “Use normal FTP only
- Change the connection type “Normal
- Enter the username/password.
- Ok/Connection to continue
January 2023 Update:
You can now prevent PC problems by using this tool, such as protecting you against file loss and malware. Additionally it is a great way to optimize your computer for maximum performance.
The program fixes common errors that might occur on Windows systems with ease — no need for hours of troubleshooting when you have the perfect solution at your fingertips:
- Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
- Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
- Step 3 : Click “Repair All” to fix all issues.
Disable the System Firewall
If such problems occur while it is working for one instance, but not for another – in this case FTP works locally, but not remotely – the first thing you should try is to disable the firewall to see if it makes a difference. If you are using the Windows firewall, disable it and you can connect to the FTP server remotely via the system.
Send the PASV command to the server.
When you send the port command to your server, ask the server to connect to you (in the remote network). If the remote network also has a NAT router and you have not redirected the port you are sending with your PORT command, the server cannot reach you.
The most common solution would be to send the PASV command to the server instead of the PORT command. The PASV command prompts the server to create a listening record and accept a connection from the remote computer to establish the data connection.
For the PASV command to work, you must also forward a number of ports for passive data connections. Passive connection ports (which must be forwarded) must be listed in the FileZilla documentation.
Change the transfer method to Active.
To resolve this FTP error, do the following:
- Open Filezilla, go to Edit -> Settings
- Click on Connection -> FTP : Select On.
- Click on Connection -> FTP -> Active mode: select “Request external IP address from your operating system”.
- Click on Connection -> FTP -> Passive mode: Select Return to active mode.
CONCLUSION
In short, the FTP error “could not retrieve the list of directories” in cPanel occurs due to server firewall restrictions, FTP client settings and more.
https://forum.filezilla-project.org/viewtopic.php?t=7315
Expert Tip: This repair tool scans the repositories and replaces corrupt or missing files if none of these methods have worked. It works well in most cases where the problem is due to system corruption. This tool will also optimize your system to maximize performance. It can be downloaded by Clicking Here
CCNA, Web Developer, PC Troubleshooter
I am a computer enthusiast and a practicing IT Professional. I have years of experience behind me in computer programming, hardware troubleshooting and repair. I specialise in Web Development and Database Design. I also have a CCNA certification for Network Design and Troubleshooting.
Post Views: 256
I’m trying to use winSCP to FTP my server using FTPs and then synch with a backup folder. I have had this working fine from a PC on my work intranet (i.e. the same domain) however when I try to set it up off site (which is my whole point) the same script fails. The FTP log is as follows..
. 2010-09-09 15:28:30.952 --------------------------------------------------------------------------
. 2010-09-09 15:28:30.952 WinSCP Version 4.2.8 (Build 818) (OS 5.2.3790 Service Pack 2)
. 2010-09-09 15:28:30.952 Login time: 09 September 2010 15:28:30
. 2010-09-09 15:28:30.952 --------------------------------------------------------------------------
. 2010-09-09 15:28:30.952 Session name: user1@myserver.nhs.uk
. 2010-09-09 15:28:30.952 Host name: myserver.nhs.uk (Port: 21)
. 2010-09-09 15:28:30.952 User name: user1 (Password: Yes, Key file: No)
. 2010-09-09 15:28:30.952 Tunnel: No
. 2010-09-09 15:28:30.952 Transfer Protocol: FTP
. 2010-09-09 15:28:30.952 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2010-09-09 15:28:30.952 Proxy: none
. 2010-09-09 15:28:30.952 FTP: FTPS: Explicit SSL; Passive: No [Force IP: No]
. 2010-09-09 15:28:30.952 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-09-09 15:28:30.952 Cache directory changes: Yes, Permanent: Yes
. 2010-09-09 15:28:30.952 DST mode: 1
. 2010-09-09 15:28:30.952 --------------------------------------------------------------------------
. 2010-09-09 15:28:30.968 Connecting to myserver.nhs.uk ...
. 2010-09-09 15:28:30.984 Connected with myserver.nhs.uk, negotiating SSL connection...
< 2010-09-09 15:28:30.999 220 Microsoft FTP Service
> 2010-09-09 15:28:30.999 AUTH SSL
< 2010-09-09 15:28:31.031 234 AUTH command ok. Expecting TLS Negotiation.
. 2010-09-09 15:28:31.187 SSL connection established. Waiting for welcome message...
> 2010-09-09 15:28:31.187 USER user1
< 2010-09-09 15:28:31.218 331 Password required for user1.
> 2010-09-09 15:28:31.218 PASS ********
< 2010-09-09 15:28:31.234 230 User logged in.
> 2010-09-09 15:28:31.234 SYST
< 2010-09-09 15:28:31.265 215 Windows_NT
> 2010-09-09 15:28:31.265 FEAT
< 2010-09-09 15:28:31.281 211-Extended features supported:
< 2010-09-09 15:28:31.281 LANG EN*
< 2010-09-09 15:28:31.281 UTF8
< 2010-09-09 15:28:31.281 AUTH TLS;TLS-C;SSL;TLS-P;
< 2010-09-09 15:28:31.281 PBSZ
< 2010-09-09 15:28:31.281 PROT C;P;
< 2010-09-09 15:28:31.281 CCC
< 2010-09-09 15:28:31.296 HOST
< 2010-09-09 15:28:31.296 SIZE
< 2010-09-09 15:28:31.296 MDTM
< 2010-09-09 15:28:31.296 REST STREAM
< 2010-09-09 15:28:31.296 211 END
> 2010-09-09 15:28:31.296 OPTS UTF8 ON
< 2010-09-09 15:28:31.312 200 OPTS UTF8 command successful - UTF8 encoding now ON.
> 2010-09-09 15:28:31.312 PBSZ 0
< 2010-09-09 15:28:31.343 200 PBSZ command successful.
> 2010-09-09 15:28:31.343 PROT P
< 2010-09-09 15:28:31.359 200 PROT command successful.
. 2010-09-09 15:28:31.359 Connected
. 2010-09-09 15:28:31.359 --------------------------------------------------------------------------
. 2010-09-09 15:28:31.359 Using FTP protocol.
. 2010-09-09 15:28:31.359 Doing startup conversation with host.
> 2010-09-09 15:28:31.359 PWD
< 2010-09-09 15:28:31.390 257 "/" is current directory.
. 2010-09-09 15:28:31.390 Getting current directory name.
. 2010-09-09 15:28:31.390 Retrieving directory listing...
> 2010-09-09 15:28:31.390 TYPE A
< 2010-09-09 15:28:31.406 200 Type set to A.
> 2010-09-09 15:28:31.421 PORT 10,222,54,3,6,38
< 2010-09-09 15:28:31.437 200 PORT command successful.
> 2010-09-09 15:28:31.437 LIST -a
< 2010-09-09 15:28:31.468 150 Opening ASCII mode data connection.
. 2010-09-09 15:28:46.968 Timeout detected.
. 2010-09-09 15:28:46.968 Could not retrieve directory listing
* 2010-09-09 15:28:46.968 (ESshFatal) Lost connection.
* 2010-09-09 15:28:46.968 Timeout detected.
* 2010-09-09 15:28:46.968 Could not retrieve directory listing
* 2010-09-09 15:28:46.968 Opening ASCII mode data connection.
* 2010-09-09 15:28:46.968 Error listing directory '/'.
. 2010-09-09 15:28:51.999 Connecting to myserver.nhs.uk ...
. 2010-09-09 15:28:52.015 Connected with myserver.nhs.uk, negotiating SSL connection...
< 2010-09-09 15:28:52.031 220 Microsoft FTP Service
> 2010-09-09 15:28:52.031 AUTH SSL
< 2010-09-09 15:28:52.062 234 AUTH command ok. Expecting TLS Negotiation.
. 2010-09-09 15:28:52.140 SSL connection established. Waiting for welcome message...
> 2010-09-09 15:28:52.140 USER user1
< 2010-09-09 15:28:52.156 331 Password required for user1.
> 2010-09-09 15:28:52.156 PASS ********
< 2010-09-09 15:28:52.187 230 User logged in.
> 2010-09-09 15:28:52.187 SYST
< 2010-09-09 15:28:52.202 215 Windows_NT
> 2010-09-09 15:28:52.202 FEAT
< 2010-09-09 15:28:52.234 211-Extended features supported:
< 2010-09-09 15:28:52.234 LANG EN*
< 2010-09-09 15:28:52.234 UTF8
< 2010-09-09 15:28:52.234 AUTH TLS;TLS-C;SSL;TLS-P;
< 2010-09-09 15:28:52.234 PBSZ
< 2010-09-09 15:28:52.234 PROT C;P;
< 2010-09-09 15:28:52.234 CCC
< 2010-09-09 15:28:52.234 HOST
< 2010-09-09 15:28:52.234 SIZE
< 2010-09-09 15:28:52.234 MDTM
< 2010-09-09 15:28:52.234 REST STREAM
< 2010-09-09 15:28:52.234 211 END
> 2010-09-09 15:28:52.234 OPTS UTF8 ON
< 2010-09-09 15:28:52.265 200 OPTS UTF8 command successful - UTF8 encoding now ON.
> 2010-09-09 15:28:52.265 PBSZ 0
< 2010-09-09 15:28:52.281 200 PBSZ command successful.
> 2010-09-09 15:28:52.281 PROT P
< 2010-09-09 15:28:52.312 200 PROT command successful.
. 2010-09-09 15:28:52.312 Connected
. 2010-09-09 15:28:52.312 Doing startup conversation with host.
. 2010-09-09 15:28:52.312 Getting current directory name.
. 2010-09-09 15:28:52.312 Retrieving directory listing...
> 2010-09-09 15:28:52.312 PWD
< 2010-09-09 15:28:52.343 257 "/" is current directory.
> 2010-09-09 15:28:52.343 TYPE A
< 2010-09-09 15:28:52.359 200 Type set to A.
> 2010-09-09 15:28:52.359 PORT 10,222,54,3,6,40
< 2010-09-09 15:28:52.390 200 PORT command successful.
> 2010-09-09 15:28:52.390 LIST -a
< 2010-09-09 15:28:52.406 150 Opening ASCII mode data connection.
This fails whether I run from GUI or a previously tested and working scripted version. It looks from the log like theres a problem with a timeout on the directory listing, presumably it works locally as less lag
Any ideas if this is a winSCP setting (and if so where) or on the FTPserver side (Windows Web Server 2008 R2) ?