After forcing strict firewall rules (deny everything) and creating following exceptions with ufw:
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
22/tcp LIMIT Anywhere
21/tcp ALLOW Anywhere
990/tcp ALLOW Anywhere
20/tcp ALLOW Anywhere
989/tcp ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
22/tcp (v6) LIMIT Anywhere (v6)
21/tcp (v6) ALLOW Anywhere (v6)
990/tcp (v6) ALLOW Anywhere (v6)
20/tcp (v6) ALLOW Anywhere (v6)
989/tcp (v6) ALLOW Anywhere (v6)
I'm still not able to log-in via ftp client such as FileZilla. Using ufw disable allows connection without problems. I bet there is some port I missed. There is vsftpd server running on the linux machine. Connection is done via explicit FTP over TLS. The log of the client when ufw is enabled is:
Status: Connecting to xx.xx....
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is the current directory
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (85,255,3,229,40,216).
Command: LIST
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing