On Thu, 06 Nov 2008 16:18:00 -0600, Allen Kistler wrote:
> General Schvantzkoph wrote:
>> On Thu, 06 Nov 2008 10:03:54 -0600, Allen Kistler wrote:
>>
>>> General Schvantzkoph wrote:
>>>> I've installed vsftp on a CentOS 5.2 box and I've port forwarded
>>>> ports 20-21 to the box. It works fine when FTPing from a shell
>>>> (although the password authentication takes a long time) but not from
>>>> an FTP GUI client. I first tried it from a Windows client (WinSCP)
>>>> but it failed with a timeout error. I then tried it from gFTP which
>>>> gave be the error message when I accessed via the Internet (local
>>>> access worked)
>>>>
>>>> 425 Security: Bad IP connecting.
>>>>
>>>> Are there some additional ports that I need to port forward?
>>>>
>>>> Here is my vsftp.conf file,
>>>>
>>>> [snip]
>>> The problem is passive vs. active transfers. FTP uses two ports.
>>>
>>> Port 21 on the server is the control channel. You forwarded that
>>> fine.
>>>
>>> In active mode, port 20 on the server is the data channel. The server
>>> initiates connections from port 20. You don't have to forward packets
>>> to port 20, assuming whatever you've got forwarding packets knows
>>> about ftp. The Windows command line ftp uses active mode.
>>>
>>> In passive mode, the client initiates the data channel from a random
>>> high port to a random high port on the server. The server tells the
>>> client which high port to use on the server. You'd have to forward
>>> every high port if whatever you've got forwarding packets doesn't know
>>> how to deal with ftp. Most clients that are not the Windows command
>>> line client use passive mode.
>>>
>>> If you're using a Linux box and netfilter to do the port forwarding,
>>> make sure you've got ip_conntrack_ftp and ip_nat_ftp (or
>>> nf_conntrack_ftp and nf_nat_ftp, depending on your kernel version)
>>> modules loaded.
>>>
>>> If you're not using netfilter to do the port forwarding, then you'll
>>> have to read up on ftp support in whatever you've got forwarding
>>> packets.
>>
>> I'm using a Dlink router. I've tried port forwarding 1024-65535 to the
>> server box, that didn't do it. In gFTP I was able to disable passive
>> mode and that mad it work, however it seems to be harder to do for
>> Windows Clients, most of which are pretty crappy compared to gFTP. I
>> couldn't get WinSCP or Filezilla to work however I was able to get
>> CoreFTP to work, it has the ability to limit the port range and it has
>> a means of disabling passive mode that seems to work.
>
> You could probably also put "pasv_enable=NO" in your vsftpd.conf. That
> way at least your server would be less of a tease to clients that wanted
> to try passive. I'm not certain it would fix anything, though.
pasv_enable=NO doesn't seem to have any effect on WinSCP and Filezilla,
gFTP works even with passive enabled and CoreFTP still works.
|