Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with alternative Python FTP Server behind NAT
#1
I am running Ubuntu 16.04 with newest EHCP 0.38.3.b.
The server is behind NAT. I've setup proper local IP ("local IP of server") and a proper public IP ("dnsip (outside/real/static ip of server)". I have also redirected port tcp/2121 on my router.

While there was no problem with vsftpd in such configuration before, the new python-based ftp daemon seems to not handle passive transmission in a proper way.

I have tried TotalCmd, FileZilla and Chrome. The connection seems to be establishing for a while but then it times out.

Here are my logs from Filezilla:

Status: Resolving address of xxxx
Status: Connecting to 81.18.xx.xx:2121...
Status: Connection established, waiting for welcome message...
Response: 220-Welcome to python based EHCP Ftp Server, managed by EHCP (Easy Hosting Control Panel, www.ehcp.net) (Beta)
Response: 220
Command: AUTH TLS
Response: 500 Command "AUTH" not understood.
Command: AUTH SSL
Response: 500 Command "AUTH" not understood.
Status: Insecure server, it does not support FTP over TLS.
Command: USER xxxxx
Response: 331 Username ok, send password.
Command: PASS ************
Response: 230 Login successful.
Command: OPTS UTF8 ON
Response: 501 Invalid argument.
Command: OPTS MLST type;perm;size;modify;unix.mode;unix.uid;unix.gid;
Response: 200 MLST OPTS type;perm;size;modify;unix.mode;unix.uid;unix.gid;
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is the current directory.
Command: TYPE I
Response: 200 Type set to: Binary.
Command: PASV
Response: 227 Entering passive mode (172,26,154,2,159,176).
Status: Server sent passive reply with unroutable address. Using server address instead.
Command: MLSD
Response: 150 File status okay. About to open data connection.
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing


And ehcp_ftp log:

INFO:root:Ehcp ftpserver:Rebuilding/adding users:
INFO:pyftpdlib:>>> starting FTP server on 0.0.0.0:2121, pid=3154 <<<
INFO:pyftpdlib:concurrency model: async
INFO:pyftpdlib:masquerade (NAT) address: None
INFO:pyftpdlib:passive ports: None
INFO:pyftpdlib:83.28.210.220:62612-[] FTP session opened (connect)
INFO:pyftpdlib:83.28.210.220:62612-[xxxxxx] USER 'xxxxxxx' logged in.
INFO:pyftpdlib:83.28.210.220:62612-[xxxxxx] FTP session closed (disconnect).


*** SOLUTION ***

Now, it seems that pyftpdlib silently ignores EHCP setting of public IP address.
So now I am trying to add it manually do the /var/www/new/ehcp/ftp_server2.py script:

# Specify a masquerade address and the range of ports to use for
# passive connections. Decomment in case you're behind a NAT.
handler.masquerade_address = '81.18.xx.xx'
handler.passive_ports = range(61800, 61899)

And of course and proper NAT port redirections to my router config.

Now.. everything is fine. Connection established.


TO DO: pls add handling of server public IP to the ftp_server2.py script

Regards

PP


Restored from old drupal forum, for user uid:34616 username:premax
You may reset your password to access your new account here.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping