-1

I have a "vsftpd" server running on a RHEL machine which is configured for anonymous communication.

I am trying to connect to it from a AIX 7.1 machine using ftp client.

ftp -snv host 8043
Connected to host
220 secure FTP service
ftp> user anonymous mypass
234 Proceed with negotiation.
TLS Auth Entered.

Certificate:
     ....
     ....
TLSv1/SSLv3 ( ECDHE-RSA-AES256-GCM-SHA384 ), 256 bits
331 Please specify the password.
230 Login successful.
200 PBSZ set to 0.
200 PROT now Private.
ftp> passive
Passive mode  on.
ftp> cd /incoming
250 Directory successfully changed.
ftp> quote pwd
257 "/incoming"
ftp> ls -r
227 Entering Passive Mode (XXX,XXX,XXX,XX,XXX,XX).
ftp: connect: Connection timed out
ftp>

As seen above, the cd and quote pwd command seems to work fine. But ls -r and mput commands fail with Connection timed out error.

No real helpful messages on the server logs also.

Please help on debugging and identifying the issue.

PS: The lftp clients from RHEL work fine connecting to the server.

Fazlin
  • 2,285
  • 17
  • 29
  • 1
    Very few AIX people here. You may get lucky. I would join ittoolbox.com and post to their forums (I don't remember exact name anymore, but more AIX people there). OR goto the IBM support website as that is the golden source. Good luck. – shellter Sep 03 '20 at 17:58
  • 2
    FTP opens two ports. You are getting the command connection, but not the data connection. Firewall trouble? Have you tried it without passive? Or look at tcpdump if it even attempts the second connection. –  Sep 03 '20 at 20:50
  • This is not a [programming question](https://stackoverflow.com/help/on-topic) anyway. – Martin Prikryl Sep 04 '20 at 06:40
  • @dratenik: Thanks for the response. As you have mentioned, control connection worked and data connection did not. My thought was `cd` command should have also not worked if data connection is not proper. I have now opened the data port and it works fine now. – Fazlin Sep 04 '20 at 09:28
  • meh, let's make it an answer then –  Sep 04 '20 at 09:36

1 Answers1

1

FTP needs to open two connections to work properly. One for control and one for data. Whenever you get "cd works but ls doesn't", the data connection is not getting established.

Troubleshooting tips:

  • look for any firewalls/NATs along the way
  • try toggling active/passive mode, this opens the data connection from the other side
  • look at what is happening using network debugging tools like tcpdump/wireshark