giampaolo / pyftpdlib

Extremely fast and scalable Python FTP server library
MIT License
1.65k stars 265 forks source link

FTP server stuck #617

Closed ttkrpink closed 7 months ago

ttkrpink commented 8 months ago

Running FTPServer inside Django, And Django Running inside a docker container.

My setup is very simple.

When I ftp from windows cmd. Login is ok, CD is ok. "ls" stuck, “get” stuck with the same error message.

I think the permission is fine. and Login with root. I tried running it outside docker container. The result is the same: 150 File status okay. About to open data connection.

Any help is appreciated.

Thanks

ftp> ls
150 File status okay. About to open data connection.

image

xillmera commented 8 months ago

Simular. Probably, last ver is broken. I have next output after EPRT comm.: [D 2023-11-12 16:55:24] [debug] call: close() (<pyftpdlib.handlers.ActiveDTP *.*.*.*:48481 at 0x7f1e553a9a20>)

xillmera commented 8 months ago

this fact means, that it is necessary to have range of passive ports. Problem can be solved by line from docs 'handler.passive_ports = range(60000, 65535)' and open range of ports in firewall 'ufw allow 60000:65535/tcp'

giampaolo commented 7 months ago

Indeed EPRT / PORT active data connection is usually not recommended, because the client needs to have an open port / port forwarding for the incoming connection. EPSV / PASV should be instead. Closing.