This KB describes the scenario where FTP connection to the Junos devices might be delayed or timed-out.
The customer reported that FTP attempts to the Junos device gets time-out. After changing the client's setting to wait for a long time, the client was able to authenticate to the FTP server running on Junos, but there was about 30 seconds delay in authentication process after the initial attempt.Based on the packet capture, the 3-way handshake for the new FTP session was done without any delays, but there was 30 seconds interval until the login prompt was seen.After the successful authentication, everything worked normally.
The root cause of the behavior is that there was a name-server configuration which is not-reachable.Junos uses FreeBSD's built-in FTP and Telnet daemon, and both of them try to resolve the client's IP through name-server if configured.They both wait for about 30 seconds before they determine that the name-server is not working or not-reachable, before starting authentication.Therefore, you can resolve this by either deleting the name-server configuration or configure the reachable server only.