Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, i have two VPS's. One has no problem with connecting and transferring files through FTP client but the other one has error when i try. My CentOS 5 (64-bit) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    13

    Question Proftpd 500 Illegal port command on CentOS 5.8


    Hi, i have two VPS's. One has no problem with connecting and transferring files through FTP client but the other one has error when i try.
    My CentOS 5 (64-bit) OpenVZ server has no problem. I can connect through FTP and upload files.

    But when i try to connect to my Xen, CentOS 5.8 (64-bit) server through FTP client, there comes this error:

    ----------------------
    Status: Server does not support non-ASCII characters.
    Status: Connected
    Status: Retrieving directory listing...
    Command: PWD
    Response: 257 "/" is the current directory
    Command: TYPE I
    Response: 200 Type set to I
    Command: PORT 192,168,1,2,19,203
    Response: 500 Illegal PORT command
    Command: PASV
    -------------------------

    I tried both passive and active modes, no success.
    I thought it was problem with my ISP blocking the port or something but strange that my other server has no problem connecting but not the other one.

    Please recommend any solutions?
    thanks in advance guys

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Hi,

    Must you use Proftpd? I have nothing against it, but there is a perfectly usable one already there - vsftpd. At the least, you can run it temporarily and see if you can connect to it.

    Also, do you have a firewall running?

    Do you have SELinux enabled?

    Is there anything on the server-side FTP logs?

    Try sniffing the traffic from the server, too. If you have ngrep, you could try something like:
    Code:
     ngrep -wi -d any port 21
    then try to connect with your client.

  3. #3
    Just Joined!
    Join Date
    Feb 2013
    Posts
    13
    Quote Originally Posted by atreyu View Post
    Hi,

    Must you use Proftpd? I have nothing against it, but there is a perfectly usable one already there - vsftpd. At the least, you can run it temporarily and see if you can connect to it.

    Also, do you have a firewall running?

    Do you have SELinux enabled?

    Is there anything on the server-side FTP logs?

    Try sniffing the traffic from the server, too. If you have ngrep, you could try something like:
    Code:
     ngrep -wi -d any port 21
    then try to connect with your client.
    Hi there, thanks for your reply.

    Well directadmin or CentOS 5.8 automatically installs proftpd so i didn't try to remove and install different ftp.

    I tried your command and it's this:

    ------------
    filter: (ip) and ( port 21 )
    ####
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    220 ProFTPD 1.3.3c Server ready...
    #
    T x.x.x.x:21204 -> x.x.x.x:21 [AP]
    USER admin@domain.com..
    ##
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    331 Password required for admin@domain.com..
    #
    T 1x.x.x.x:21204 -> x.x.x.x:21 [AP]
    PASS xxxxxx..
    #
    T 192.210.200.165:21 -> 122.201.18.118:21204 [AP]
    230 User admin@domain.com logged in..
    #
    T x.x.x.x:21204 -> x.x.x.x:21 [AP]
    SYST..
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    215 UNIX Type: L8..
    #
    T x.x.x.x:21204 -> x.x.x.x:21 [AP]
    FEAT..
    #
    T 1x.x.x.x:21 -> x.x.x.x:21204 [AP]
    211-Features:.. MDTM.. MFMT.. TVFS.. MFF modify;UNIX.group;UNIX.mode;.. MLS
    T modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX .mode*;UNIX.owner*;.. R
    EST STREAM.. SIZE..
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    211 End..
    ##
    T 1x.x.x.x:21204 -> x.x.x.x:21 [AP]
    PWD..
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    257 "/" is the current directory..
    #
    T 1x.x.x.x:21204 -> x.x.x.x:21 [AP]
    TYPE I..
    #
    T x.x.x.x.165:21 -> x.x.x.x:21204 [AP]
    200 Type set to I..
    #
    T 1x.x.x.x:21204 -> x.x.x.x:21 [AP]
    PORT 172,28,1,141,14,220..
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    500 Illegal PORT command..
    #
    T x.x.x.x:21204 -> x.x.x.x:21 [AP]
    PASV..
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    227 Entering Passive Mode (192,210,200,165,138,97)...
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    227 Entering Passive Mode (192,210,200,165,138,97)...
    #
    T x.x.x.x:21204 -> x.x.x.x:21 [AP]
    PASV..
    ##
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    227 Entering Passive Mode (192,210,200,165,138,97)...
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    227 Entering Passive Mode (192,210,200,165,138,97)...
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    227 Entering Passive Mode (192,210,200,165,138,97)...
    #
    T x.x.x.x:21 -> 1x.x.x.x:21204 [AP]
    227 Entering Passive Mode (192,210,200,165,138,97)...
    #
    T x.x.x.x:21 -> x.x.x.x:21204 [AP]
    227 Entering Passive Mode (192,210,200,165,138,97)...
    exit
    32 received, 0 dropped
    -----------


    and it's not connecting through client

  4. #4
    Just Joined!
    Join Date
    Feb 2013
    Posts
    13
    And looks like SELinux is disabled because when i type vi /etc/selinux/config there is no file or folder exists and it makes new file

  5. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by mailnet View Post
    And looks like SELinux is disabled because when i type vi /etc/selinux/config there is no file or folder exists and it makes new file
    That is odd? That file is usually there, even if it is disabled or uninstalled? What does this command tell you?
    Code:
    getenforce
    How about the firewall, is it running?
    Code:
    service iptables status
    If it is running, temporarily stop it (but don't forget to restart it later):
    Code:
    service iptables stop
    Did you try vsftpd? First stop proftpd:
    Code:
    service proftpd stop
    Then install vsftpd, if not installed:
    Code:
    yum install vsftpd
    Then start vsftpd:
    Code:
    service vsftpd start
    btw, as to your original problem w/proftpd, perhaps it has to do with proftpd requiring passive ports being defined in the config file. See this thread about that.

  6. #6
    Just Joined!
    Join Date
    Feb 2013
    Posts
    13
    Getenforce: disabled

    Service iptables status: Firewall is stopped.

    I tried vsftpd and installed it. But when i type service vsftpd start:
    Starting vsftpd for vsftpd: [FAILED]

  7. #7
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by mailnet View Post
    I tried vsftpd and installed it. But when i type service vsftpd start:
    Starting vsftpd for vsftpd: [FAILED]
    that sounds familiar...i think it is a config file/permissions problem. Is there anything in /var/log/messages, or in the ftp log? Try /var/log/xferlog.

    also, try running it by hand. as root, in a terminal, do:
    Code:
    /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
    assuming that is the correct path to the vsfptd binary and config file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •