Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am troubleshooting an issue with the ftp connection from a specific client to the server. Set it to passive mode is unfortunately not an option. I am using ncftp in debugging mode to test the connection.

[myself@newqa ~]$ ncftp
NcFTP 3.2.4 (Apr 07, 2010) by Mike Gleason (http://www.NcFTP.com/contact/).
ncftp> debug
ncftp> passive
> passive

passive                        on
ncftp> passive
> passive

passive                        off
ncftp> open -u ftpuser my.server.com
> open -u ftpuser my.server.com

LibNcFTP 3.2.4 (April 3, 2010) compiled for linux-x86_64-glibc2.12
Uname: Linux|my.client.com|2.6.32-279.19.1.el6.x86_64|#1 SMP Sat Nov 24 14:35:28 EST 2012|x86_64
Contents of /etc/redhat-release:
  Red Hat Enterprise Linux Server release 6.3 (Santiago)
Contents of /etc/issue:
  Red Hat Enterprise Linux Server release 6.3 (Santiago)
  Kernel \r on an \m
Glibc: 2.12 (stable)

Hello, dear user!
220: Hello, dear user!
Connected to 12.34.56.78.
Cmd: USER ftpuser

Password requested by 12.34.56.78 for user "ftpuser".

    Please specify the password.

Password: ***********
331: Please specify the password.
Cmd: PASS xxxxxxxx

Login successful.
230: Login successful.
Cmd: PWD
257: "/"
Logged in to 12.34.56.78 as username.
Cmd: FEAT
211: Features:
      EPRT
      EPSV
      MDTM
      PASV
      REST STREAM
      SIZE
      TVFS
     End
Cmd: HELP SITE
214: The following commands are recognized.
      ABOR ACCT ALLO APPE CDUP CWD  DELE EPRT EPSV FEAT HELP LIST MDTM MKD
      MODE NLST NOOP OPTS PASS PASV PORT PWD  QUIT REIN REST RETR RMD  RNFR
      RNTO SITE SIZE SMNT STAT STOR STOU STRU SYST TYPE USER XCUP XCWD XMKD
      XPWD XRMD
     Help OK.
Logged in to www.server.com.
Cmd: CLNT NcFTP 3.2.4 linux-x86_64-glibc2.12
500: Unknown command.
ncftp / > dir
> dir

Cmd: PORT 10,36,219,101,167,190
Could not read reply from control connection -- timed out.
Could not read reply from control connection -- timed out.
List failed.

The machine is hosted in amazon and firewall is configured to allow all TCP incoming trafic from the ip of my server to the client.

iptables is disabled in the client

[root@newqa ~]# /etc/init.d/iptables status
iptables: Firewall is not running.

selinux is disabled in the client

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

Here is what i happens when i try the same from a client which is in a different network:

Logged in to my.server.com.
Cmd: CLNT NcFTP 3.2.5 linux-x86-glibc2.15
500: Unknown command.
ncftp / > dir
> dir

Cmd: PORT 192,168,1,36,221,20
200: PORT command successful. Consider using PASV.
Cmd: LIST
150: Here comes the directory listing.
226: Directory send OK.
Remote listing contents {
    drwxr-xr-x    2 ftp      ftp          4096 May 02  2013 bin
    drwxr-xr-x    2 ftp      ftp          4096 May 02  2013 dev
    drwxr-xr-x    2 ftp      ftp          4096 May 02  2013 etc
    drwxr-xr-x    3 ftp      ftp          4096 Mar 18 06:05 incoming
    drwxr-xr-x    2 ftp      ftp          4096 May 02  2013 lib
    drwxr-xr-x    2 ftp      ftp          4096 May 02  2013 lib64
    drwxr-xr-x    5 ftp      ftp          4096 May 02  2013 usr
}
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   bin
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   bin
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   dev
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   dev
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   etc
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   etc
drwxr-xr-x    3 ftp      ftp         4096   Mar 18 06:05   incoming
drwxr-xr-x    3 ftp      ftp         4096   Mar 18 06:05   incoming
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   lib
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   lib
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   lib64
drwxr-xr-x    2 ftp      ftp         4096   May  2  2013   lib64
drwxr-xr-x    5 ftp      ftp         4096   May  2  2013   usr
drwxr-xr-x    5 ftp      ftp         4096   May  2  2013   usr

Do not know where to contine troubleshotting, any suggestions?

Thanks,

share|improve this question

2 Answers 2

You are using a private IP (10.36.219.101) in the PORT command, e.g. you are not in a public network reachable by the FTP server, which is needed for active mode. If you cannot use passive mode you need to have some kind of ftp proxy on the device which separates your internal network from the public internet (e.g. NAT router or firewall) and this proxy must rewrite the FTP PORT command to use its public IP.

share|improve this answer
    
Thanks. When i connect from other machines i also see a private IP address in the PORT command(I updated the question). The client is running a webpage which is accessible externally and is linked to a DNS name. The machine is in the cloud and i connect to it using ssh. Therefore I believe that NAT translation is working ... otherwise SSH and HTTP will not work... correct? –  Lyhan Mar 25 at 9:09
up vote 0 down vote accepted

After investigating a lot and a lot of frustration... everything boils down to Amazon EC2 setup not been admin friendly and not allowing Active FTP transfer. Solution: moving the machine to a different hosting provider.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.