Сервер FileZilla - странные проблемы соединения FTP

У меня есть нечетная проблема с соединением с FTP-сервером клиента, который выполняет FileZilla v.0.9.41. Сервер работает позади маршрутизатора NAT, таким образом, он установлен принять пассивные соединения. Это, кажется, работает с НЕКОТОРЫМИ клиентами, но не ВСЕМИ. Например, с помощью Передачи от моего Mac, я соединяюсь очень хорошо. Но с помощью Ядра FTP из Windows, у меня есть следующая ошибка:

PORT command failed
Error loading directory...

И это находится там неограниченно долго. Используя Передачу, это не проблема.

Я не действую позади брандмауэра, и при этом я не использую сервис программного брандмауэра. Каждое устройство, которое подключения находятся на той же подсети, с помощью того же маршрутизатора для ухода к Интернету. Учетные данные являются тем же, и базовая конфигурация является тем же (Пассивный, Двоичный, и т.д.).

То, где я заблудился, выясняет, почему один клиент соединится без проблемы, в то время как большинство других соединяется, но не позволит мне пересекать структуру каталогов.

Кто-либо видел это поведение прежде, и если так, у кого-либо есть мысли о решении?

Примечание: У меня нет доступа к Серверу FileZilla, но у меня действительно есть копии конфигурационных XML-файлов для поиска и устранения неисправностей.

Править: Посмотрите журнал ниже.

Welcome to Core FTP, release ver 2.2, build 1798 (x86.U) -- � 2003-2014
WinSock 2.0
Mem -- 2,097,151 KB, Virt -- 2,097,024 KB
Started on Wednesday September 03, 2014 at 15:45:PM
Connect socket #796 to <Server IP Address>, port 21...
220-FileZilla Server version 0.9.41 beta  
220-written by Tim Kosse (Tim.Kosse@gmx.de)  
220-FileZilla Server version 0.9.41 beta  
USER <User>  
331 Password required for <User>  
PASS **********  
230 Logged on  
SYST  
215 UNIX emulated by FileZilla  
Keep alive off...
CWD /Inbound/  
250 CWD successful. "/Inbound" is current directory.  
PASV  

PORT command failed
Error loading directory...

И вот конфигурация сервера FileZilla:

<FileZillaServer>
    <Groups />
    <Users>
        <User Name="USER">
            <Option Name="Pass">pass</Option>
            <Option Name="Group" />
            <Option Name="Bypass server userlimit">0</Option>
            <Option Name="User Limit">0</Option>
            <Option Name="IP Limit">0</Option>
            <Option Name="Enabled">1</Option>
            <Option Name="Comments" />
            <Option Name="ForceSsl">0</Option>
            <IpFilter>
                <Disallowed />
                <Allowed />
            </IpFilter>
            <Permissions>
                <Permission Dir="C:\inetpub\FTP">
                    <Option Name="FileRead">1</Option>
                    <Option Name="FileWrite">1</Option>
                    <Option Name="FileDelete">1</Option>
                    <Option Name="FileAppend">1</Option>
                    <Option Name="DirCreate">0</Option>
                    <Option Name="DirDelete">0</Option>
                    <Option Name="DirList">1</Option>
                    <Option Name="DirSubdirs">1</Option>
                    <Option Name="IsHome">1</Option>
                    <Option Name="AutoCreate">0</Option>
                </Permission>
            </Permissions>
            <SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="0" UlType="0" UlLimit="10" ServerUlLimitBypass="0">
                <Download />
                <Upload />
            </SpeedLimits>
        </User>
    </Users>
    <Settings>
        <Item name="Serverports" type="string">21</Item>
        <Item name="Number of Threads" type="numeric">2</Item>
        <Item name="Maximum user count" type="numeric">0</Item>
        <Item name="Timeout" type="numeric">120</Item>
        <Item name="No Transfer Timeout" type="numeric">600</Item>
        <Item name="Allow Incoming FXP" type="numeric">1</Item>
        <Item name="Allow outgoing FXP" type="numeric">1</Item>
        <Item name="No Strict In FXP" type="numeric">0</Item>
        <Item name="No Strict Out FXP" type="numeric">0</Item>
        <Item name="Login Timeout" type="numeric">60</Item>
        <Item name="Show Pass in Log" type="numeric">0</Item>
        <Item name="Custom PASV IP type" type="numeric">1</Item>
        <Item name="Custom PASV IP" type="string">SAME AS OUTWARD FACING SERVER IP</Item>
        <Item name="Custom PASV min port" type="numeric">0</Item>
        <Item name="Custom PASV max port" type="numeric">0</Item>
        <Item name="Initial Welcome Message" type="string">%v&#x0D;&#x0A;written by Tim Kosse (Tim.Kosse@gmx.de)&#x0D;&#x0A;Please visit http://sourceforge.net/projects/filezilla/</Item>
        <Item name="Admin port" type="numeric">14147</Item>
        <Item name="Admin Password" type="string"></Item>
        <Item name="Admin IP Bindings" type="string"></Item>
        <Item name="Admin IP Addresses" type="string"></Item>
        <Item name="Enable logging" type="numeric">0</Item>
        <Item name="Logsize limit" type="numeric">0</Item>
        <Item name="Logfile type" type="numeric">0</Item>
        <Item name="Logfile delete time" type="numeric">0</Item>
        <Item name="Use GSS Support" type="numeric">0</Item>
        <Item name="GSS Prompt for Password" type="numeric">0</Item>
        <Item name="Download Speedlimit Type" type="numeric">0</Item>
        <Item name="Upload Speedlimit Type" type="numeric">0</Item>
        <Item name="Download Speedlimit" type="numeric">10</Item>
        <Item name="Upload Speedlimit" type="numeric">10</Item>
        <Item name="Buffer Size" type="numeric">32768</Item>
        <Item name="Custom PASV IP server" type="string">http://ip.filezilla-project.org/ip.php</Item>
        <Item name="Use custom PASV ports" type="numeric">0</Item>
        <Item name="Mode Z Use" type="numeric">0</Item>
        <Item name="Mode Z min level" type="numeric">1</Item>
        <Item name="Mode Z max level" type="numeric">9</Item>
        <Item name="Mode Z allow local" type="numeric">0</Item>
        <Item name="Mode Z disallowed IPs" type="string"></Item>
        <Item name="IP Bindings" type="string">LOCAL IP ADDRESS</Item>
        <Item name="IP Filter Allowed" type="string"></Item>
        <Item name="IP Filter Disallowed" type="string"></Item>
        <Item name="Hide Welcome Message" type="numeric">0</Item>
        <Item name="Enable SSL" type="numeric">0</Item>
        <Item name="Allow explicit SSL" type="numeric">1</Item>
        <Item name="SSL Key file" type="string"></Item>
        <Item name="SSL Certificate file" type="string"></Item>
        <Item name="Implicit SSL ports" type="string">990</Item>
        <Item name="Force explicit SSL" type="numeric">0</Item>
        <Item name="Network Buffer Size" type="numeric">65536</Item>
        <Item name="Force PROT P" type="numeric">0</Item>
        <Item name="SSL Key Password" type="string"></Item>
        <Item name="Allow shared write" type="numeric">0</Item>
        <Item name="No External IP On Local" type="numeric">1</Item>
        <Item name="Active ignore local" type="numeric">1</Item>
        <Item name="Autoban enable" type="numeric">0</Item>
        <Item name="Autoban attempts" type="numeric">10</Item>
        <Item name="Autoban type" type="numeric">0</Item>
        <Item name="Autoban time" type="numeric">1</Item>
        <Item name="Service name" type="string"></Item>
        <Item name="Service display name" type="string"></Item>
        <Item name="Enable HASH" type="numeric">0</Item>
        <Item name="Disable IPv6" type="numeric">0</Item>
        <SpeedLimits>
            <Download />
            <Upload />
        </SpeedLimits>
    </Settings>
</FileZillaServer>

Править: После использования ftptest.net для поиска и устранения неисправностей я нахожу следующее:

Command: PWD Reply: 257 "/" is current directory. 
Status: Current path is / 
Command: TYPE I 
Reply: 200 Type set to I 
Command: PASV 
Reply: 227 
Entering Passive Mode (172,23,23,130,234,97)

Error: Server returned unroutable private IP address in PASV reply 
Make sure the server is configured to allow passive mode connections. 
If the server is behind a NAT router, make sure the server knows its external IP address. 
The range of ports used for passive mode must be opened in all involved firewalls. 
The range of ports used for passive mode must be forwarded by all involved NAT routers. 
Try uninstalling all firewalls and plug your computer directly into your modem, thus bypassing the router.

Я могу вывести из этого, что существует проблема о стороне сервера, но мой вопрос теперь становится, почему я могу соединиться с некоторыми клиентами (конкретно Передача на Mac) без проблемы, в то время как другие активно разъединяются (как Ядро FTP в Windows)?

1
задан 4 September 2014 в 04:24
2 ответа

Решение:

Клиенту необходимо изменить настройку

    <Item name="Custom PASV IP" type="string">SAME AS OUTWARD FACING SERVER IP</Item>

на IP-адрес маршрутизатора, выполняющего NATing.

Объяснение:

В соответствии с разделом 4.1.2 в RFC 959, после отправки PASV:

Ответ на эту команду включает в себя адрес узла и порта, на котором слушает этот сервер.

После этого, клиент может ответить другим списком IP-адресов и порта, который он хочет использовать.

Некоторые клиенты, такие как FileZilla, проверяют, что IP адрес и порт, указанный в ответе, на самом деле доступен. Другие просто предполагают, что они могут продолжать работать на том же сокене, с которого они начинали. Первое, вероятно, более корректно, так как протокол допускает изменение порта и адреса, но в этом случае он не будет работать.

Редактирование

Если FTP-сервер уже использует правильные настройки, проблема может заключаться в настройке маршрутизатора NATing/firewall/etc. Это может быть изменение данных, передаваемых через него. Способом идентификации этого может быть выполнение tcpdump с обеих сторон соединения для проверки того, что содержимое трафика одинаково.

.
3
ответ дан 3 December 2019 в 17:07

Как указывает ftptest.net, сервер не знает своего внешнего IP-адреса. Убедитесь, что вы настроили его соответствующим образом (в интерфейсе сервера FileZilla перейдите к Edit > Settings > Passive mode settings).

Обратите внимание, что некоторые клиенты молча игнорируют недействительные/немаршрутизируемые IP-адреса, возвращаемые в ответ на PASV, и вместо этого используют IP-адрес сервера. Поэтому некоторые клиенты работают даже с некорректной конфигурацией.

Хотя я не уверен, что это является причиной отказа Core FTP. Он даже не записывает в журнал ответ из PASV. Но, возможно, он проверяет ответ перед тем, как записать его в журнал. И сообщение об ошибке довольно общее (я бы ожидал, что "PORT" в сообщении об ошибке на самом деле опечатка и должен читать "PASV").

.
2
ответ дан 3 December 2019 в 17:07

Теги

Похожие вопросы