The File Transfer Protocol is a network protocol providing functionality for file access, file transfer, and file management.
In addition, FTP operates in either active or a passive mode.
Due to the wrong passive port range configuration settings on the server side, the customer may cause an error like,
"227 Entering Passive Mode (192,168,1,2,118,151).
ftp: connect: Connection timed out"
Today, we’ll see the reason for this error and how it is fixed by our Support Engineers as part of our Server Management Services.
Active and Passive modes?
In passive mode, the server decides which server-side port the client should connect to. Then the client starts the connection to the specified port.
On the other hand, in active mode, the client specifies which client-side port the data channel has opened and the server starts the connection.
Moreover, one of the main reason to occur this “227 entering passive mode FTP connect connection timed out” error is the improper configuration settings of the passive port range.
How we fixed 227 entering passive mode FTP connect connection timed out error
The error is caused due to the misconfiguration of the passive port range on the FTP server and in the firewall settings.
Therefore, our Support Engineers correct the settings in both FTP server and in the firewall.
Set passive port range in FTP server
CPanel offers a choice of two FTP servers. PureFTP and ProFTP. PureFTPd is very much secure.
Here, our Support Engineers took the following steps to add passive range port on Pureftp servers.
In Pureftpd,
To solve the error, the passive Port range should be added to the Pureftp configuration file.
1. We open Pureftp configuration file /etc/pure-ftpd.conf.
2. Then, we add the following line.
PassivePortRange 30000 35000
3. At last, we restart the Pureftp service.
service pureftpd restart
In ProFTP,
In ProFTP, we add the passive port range in /etc/proftpd.conf.
1. We open /etc/proftpd.conf and add this line.
PassivePorts 30000 35000
2. In the end, we restart the service.
service proftpd restart
Add passive port range in firewall settings
Most servers have a firewall to avoid security problems. Therefore, the passive port range should be open in the firewall configuration too.
Even if the FTP server allows passive ports, the firewall can block the connection between FTP client and server when the passive port range is not open. It results in 227 entering passive mode ftp connect connection timed out error.
Our Support Engineers use the following steps to add the passive port range to the firewall configuration file.
For firewall like Iptables,
1. Firstly, we open /etc/sysconfig/iptables file.
2. Then, we add the entry like,
iptables -I INPUT -p tcp --dport 49152:65534 -j ACCEPT
3. At last, we restart iptables
service iptables save
For firewall like CSF,
1. We open /etc/csf/csf.conf file.
2. Then, find the line with TCP_IN ,TCP_OUT and then added the port range.
# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,30000:35000"
TCP_OUT = "20,21,22,25,53,80,110,30000:35000"
3. Finally, restart the CSF service.
csf -r
service csf restart
[Getting 227 entering passive mode ftp connect connection timed out error? We’ll fix it for you.]
Conclusion
In short, the improper configuration of the passive port range in the FTP server and in the firewall configuration file are the main reasons for “227 entering passive mode ftp connect connection timed out” error. Today, we saw how our Support Engineers fixed this error.
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»;
FTP 550: В доступе отказано
Я неожиданно получаю ошибку 550: В Filezilla отказано в разрешении при попытке создать новый каталог.
Несколько дней назад я изменил некоторые настройки на сервере, касающиеся настроек ssl и imap, но я не думаю, что это повлияло на настройки FTP .
Во всяком случае, после долгого поиска в Google ничего не работает. Основная идея может состоять в том, что у пользователя нет разрешений, но интересно то, что я могу:
- создавать файлы
- удалить файлы
- удалить каталоги
Но не создание каталогов. Я получаю сообщение об ошибке «550 Permission denied» в главном каталоге и «550 access_log: нет такого файла или каталога» в подкаталоге.
Кто-нибудь знает, где может быть ошибка? Спасибо
Предполагая, что вы работаете в Linux, перейдите на один каталог вверх и посмотрите, есть ли у пользователя разрешения там. Например:
Попробуйте установить разрешения для каталога на 777. Если он работает, вы знаете, что у вас есть проблемы с разрешениями. НЕ оставляйте каталог на 777, это не безопасно, просто для быстрого тестирования. 755 обычно подходит, если у вас все настроено правильно. Вы также можете попробовать добавить пользователя в группу, которой принадлежит каталог (вы можете сделать это через ls -l). Это скажет вам, кому принадлежит это.



Группа: Участник
Сообщений: 176
Регистрация: 11.04.2008
Пользователь №: 70370
Добрый день!
Организовал FTP-сервер при помощи программного продукта — FTP Serv-U v6.0 build 6.0.0.2.
Через Far Manager,Total Commander,CuteFTP 7 Professional на FTP можно зайти без проблем (см.вложение).
Когда пытаюсь зайти через Internet Explorer, выдает следующее —
«Ошибка папки FTP: В ходе открытия папки на FTP-сервере произошла ошибка.Убедитесь, что у вас есть разрешение открывать эту папку.
Подробности:
200 Установка типа А.
227 Ввод пассивного режима ()
Вопрос — в чем может быть проблема?


Группа: Участник
Сообщений: 728
Регистрация: 02.07.2005
Пользователь №: 11680


Группа: Участник
Сообщений: 176
Регистрация: 11.04.2008
Пользователь №: 70370
спасибо! решил проблему , сейчас все нормально
Сервис-Свойство обозревателя-Дополнительно-Использовать пассивный FTP-протокол (для совместимости с брандмауэрами и DSL-модемами)
убрать галочку эту нужно
Ошибка папки FTP(200,501) как исправить?
Настроил на сервере 2008R2 FTP, прописал правила в брандмауэре на порты. Внутри сети все открывается, с внешних не хочет. Набираешь адрес, выскакивает окно запроса логинапароля, вводишь и появляется ошибка:
В ходе открытия папки на FTP-сервере произошла ошибка. Убедитесь, что у вас есть разрешение открывать эту папку.
Подробности:
200 Type set to A
501 Server cannot accept argument.
Прокси никакой нету, инет на сервер идет через шлюз TP-Link ER 5110. В нем через virtual server настроен проброс на сервер. Что это может быть и что мешает коннекту?
Доброго времени суток. Собственно, сабж в титле.
Сама ошибка выглядит по меньшей мере непонятно:
«Удаленный сервер возвратил ошибку: 227 Entering Passive Mode
(192,168,1,136,39,43)»
при чём тут ошибка? мне же и нужно в пассивный режим зайти… ладно, едем дальше.
Опыта работы с ftp нет, нашел какие то исходники, собрал проект, выдаётся вышеупомянутое исключение. Упростил код до невозможности, ошибка осталась. Странность ещё в том, что в totalCommander соединение удаётся,
private void btn_connect_Click_2(object sender, RoutedEventArgs e)
{
FtpWebRequest requestDir = (FtpWebRequest)FtpWebRequest.Create("ftp://192.168.1.136/");
requestDir.Credentials = new NetworkCredential("username", "password");
requestDir.Method = "LIST";
requestDir.UseBinary = true;
requestDir.EnableSsl = false;
requestDir.UsePassive = true;
try
{
WebResponse response = requestDir.GetResponse();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString() + ": n" + ex.Message);
}
}
пробовал так же ставить
requestDir.UsePassive = false;
Получил ошибку 500, синтаксическую, мол, команда не опознана.
Буду благодарен, если мне объяснят, что я делаю не так)
Moderator: Project members
-
Reddax
- 500 Command not understood
- Posts: 2
- Joined: 2013-05-17 14:37
- First name: James
- Last name: Morley
227 Entering Passive Mode, Disconnected.
#1
Post
by Reddax » 2013-05-17 14:49
000089)17/05/2013 15:34:20 — james (212.183.128.67)> CLNT AndFTP
(000089)17/05/2013 15:34:20 — james (212.183.128.67)> 200 Don’t care
(000089)17/05/2013 15:34:21 — james (212.183.128.67)> PWD
(000089)17/05/2013 15:34:21 — james (212.183.128.67)> 257 «/» is current directory.
(000089)17/05/2013 15:34:21 — james (212.183.128.67)> NOOP
(000089)17/05/2013 15:34:21 — james (212.183.128.67)> 200 OK
(000089)17/05/2013 15:34:22 — james (212.183.128.67)> CWD /
(000089)17/05/2013 15:34:22 — james (212.183.128.67)> 250 CWD successful. «/» is current directory.
(000089)17/05/2013 15:34:23 — james (212.183.128.67)> PASV
(000089)17/05/2013 15:34:23 — james (212.183.128.67)> 227 Entering Passive Mode (86,150,105,147,215,59)
(000089)17/05/2013 15:35:27 — james (212.183.128.67)> disconnected.
As you can see, i’m trying to connect to my ftp server from an external ip and it simply says 227 entering passive mode then disconnects. I’ve opened the ports that are under passive mode settings. I have also added filezilla to the windows firewall exception. It works fine when connecting from internally. Any suggestions?
-
pedey
- 500 Command not understood
- Posts: 2
- Joined: 2013-05-30 16:42
- First name: Mike
- Last name: P
Re: 227 Entering Passive Mode, Disconnected.
#3
Post
by pedey » 2013-05-30 16:54
I’m having an identical problem behind a Sonicwall TZ170. LAN access works. Outside access allows for username/password entry, then disconnects immediately after log entry ‘227 Entering Passive Mode (x.x.x.x,136,188)’. Checked ‘Use custom port range’ in Passive mode settings in Filezilla Server options and entered 35000-36000. Forwarded those ports on Sonicwall to server IP. Also forwarded ports 20-22 and listening port 14147. Stumped. Tried using https://ftptest.net/ — does not resolve. Instead using http://www.g6ftpserver.com/en/ftptest — log below:
* About to connect() to x.x.x.x port 21 (#0)
* Trying x.x.x.x… connected
* Connected to x.x.x.x (x.x.x.x) port 21 (#0)
< 220-FileZilla Server version 0.9.41 beta
< 220-written by Tim Kosse (Tim.Kosse@gmx.de)
< 220 Please visit http://sourceforge.net/projects/filezilla/
> USER test
< 331 Password required for test
> PASS *****
< 230 Logged on
> PWD
< 257 «/» is current directory.
* Entry path is ‘/’
> CLNT Testing from http://www.g6ftpserver.com/ftptest from IP x.x.x.x
< 200 Don’t care
> FEAT
< 211-Features:
< MDTM
< REST STREAM
< SIZE
< MLST type*;size*;modify*;
< MLSD
< UTF8
< CLNT
< MFMT
< 211 End
> PASV
* Connect data stream passively
* Recv failure: Connection was reset
* Closing connection #0
curl: (56) Recv failure: Connection was reset
-
botg
- Site Admin
- Posts: 34948
- Joined: 2004-02-23 20:49
- First name: Tim
- Last name: Kosse
- Contact:
Re: 227 Entering Passive Mode, Disconnected.
#4
Post
by botg » 2013-05-30 18:10
You need to configure the server as well as all firewalls and NAT routers involved according to the Network Configuration guide.
-
pedey
- 500 Command not understood
- Posts: 2
- Joined: 2013-05-30 16:42
- First name: Mike
- Last name: P
Re: 227 Entering Passive Mode, Disconnected.
#5
Post
by pedey » 2013-05-30 19:38
Thanks. To this point, I can only access from outside if I change the listening port from 21 to something else. So I’ve changed it. Don’t know if this is unique to the firewall or if there’s something else I’m missing — I’m assuming it’s the firewall.
-
boco
- Contributor
- Posts: 26611
- Joined: 2006-05-01 03:28
- Location: Germany
Re: 227 Entering Passive Mode, Disconnected.
#6
Post
by boco » 2013-05-30 21:49
Don’t forward 14147, it’s for remote administration only.
Thanks, reported.
Your log indicated a very aggressive firewall or router. Even the reply to PASV (and thus the Passive port to use) is blocked already. As you indicate it works fine from LAN, it seems to be the router firewall.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Please do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###
As said in the title, I don’t manage to connect my Windows 10 host to my FTP server on the VirtualBox guest side (Ubuntu 18.04).
On the guest side, the vsftpd server works fine, I can connect without any problem.
So I tried to forward the associated port to the host (NAT) and tried to connect to the server via FileZilla. It does login, but always fails to retrieve directory listing. I tried deactivating the firewalls, giving all the access permissions to the folder but it doesn’t change anything.
I read that it could be a problem of passive mode there:
Problems with FTP file access to VirtualBox guest running Windows 2008 Server R2 x64
So I added the following lines to my vsftpd.conf:
pasv_enable=YES
pasv_min_port=8020
pasv_max_port=8020
port_enable=YES
pasv_address=127.0.0.1
I forwarded the port 8020 but I now get the following error on FileZilla:
The data connection could not be established: WSAEADDRNOTAVAIL — Cannot assign requested address
Full FileZilla response:
Status: Connecting to 127.0.0.1:2100...
Status: Connection established, waiting for welcome message...
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/home/cakephp" is the current directory
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (0,0,0,0,31,84).
Command: LIST
Error: The data connection could not be established:
WSAEADDRNOTAVAIL - Cannot assign requested address
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Status: Disconnected from server
I’m a bit lost with this, does anybody have a suggestion?
Thanks in advance
EDIT1:
Without any kind of hope, I also tried to access from the Windows Command Prompt. It does connect but when I ls the current folder I get the following error:
500 illegal PORT command.
425 use PORT or PASV first.
But I guess that this is because ftp.exe doesn’t support passive mode.
Just in case it can help, you can find here my whole current vsftpd config file.
Also, I can seamlessly access to the guest SSH server from the host with Putty.
EDIT2:
I set listen_ipv6 to YES, changed pasv_max_port to 8030 to increase the number of passive ports and forwarded them. I get the following logs from FileZilla:
Status: Connecting to 127.0.0.1:2100...
Status: Connection established, waiting for welcome message...
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/home/cakephp" is the current directory
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (0,0,0,0,31,90).
Command: LIST
Error: The data connection could not be established: WSAEADDRNOTAVAIL - Cannot assign requested address
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
- Remove From My Forums
-
Question
-
Hi,
I have writen a ftp client to download files from ftp. while downloading the files from the ftp I;m getting the same error (The remote server returned an error: 227 Entering Passive Mode (67,228,53,42,12,130)). Particularly I am getting this error in the line
Using response As System.Net.FtpWebResponse = CType(ftp.GetResponse, FtpWebResponse)I hope you can help me out to solve this problem.
Thanks.
Answers
-
Hi,
I have used the following code
Dim ftp As Net.FtpWebRequest = GetRequest(URI)
Here ftp is an object of FtpWebRequest .
set the property UsePassive as «False» (eg:
ftp.UsePassive = False
)
Set UsePassive property as False before before getting the response.
My code is as below:
Dim ftp As Net.FtpWebRequest = GetRequest(GetDirectory(directory))
‘Set request to do simple list
ftp.Method = Net.WebRequestMethods.Ftp.ListDirectory
ftp.UsePassive = False
‘Geting response.
Dim str As String = GetStringResponse(ftp)
Now it works fine.

