ls command in ftp> not working!

FTP is an ancient protocol. It relies on two TCP connections: a control connection over which commands are exchanged, and data connections for the content of files and also for the output of commands such as ls. What's happening here is that the control connection is established, but the data connections aren't going through.

By default (active mode), data connections are established from the sender to the receiver. For the output of ls, the data is sent by the server, so the server attempts to open a connection to the client. This worked well when FTP was invented, but nowadays, clients are often behind a firewall or NAT which may or may not support active FTP. Switch to passive mode, where the client always initiates the data connection.

Check the manual of your ftp command to see how to switch to passive mode by default. For a one-time thing, typing the command passive usually does the trick.

You may wish to switch to a nicer FTP client such as ncftp or lftp.


Full Complete solution for "ftp 500 Illegal PORT command". Click the following link: http://www.ucodice.com/articles/ftp-500-illegal-port-command/.

Excerpt

Trying to connect the ftp server & getting 500 Illegal port command. This issue may occur when ftp program is not configured for Passive mode.

You may get error snippet such as:

COMMAND:>              [3/11/2015 1:17:05 PM] PORT 192,168,0,101,196,215    
                       [3/11/2015 1:17:05 PM] 500 Illegal PORT command.    
ERROR:>                [3/11/2015 1:17:05 PM] Syntax error: command unrecognized.    
ERROR:>                [3/11/2015 1:17:05 PM] Failed to establish data socket.

To resolve this issue you can define the port or ftp in configuration file of ftp server & define the IP Address or PASV server.

Check the configuration file for below settings.

pasv_enable=YES
pasv_promiscuous=YES
pasv_max_port=Enter the max port range allowed on your server.
pasv_min_port=Enter the min port range allowed on your server.
pasv_address=Ip Address of your server.

After that restart the ftp service & check the ftp connection.