The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FTP from my Linux server isn't working

Discussion in 'General Discussion' started by madaboutlinux, Jul 22, 2010.

  1. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    This issue is driving me crazy from yesterday. Pure-Ftp on my VPS is working fine. I can connect to my server via Ftp from outside, however I cannot connect to 'localhost' or any remote server from my vps. It says

    Same message even if I try to connect to a remote server.

    Ftp is not running as xinetd, infact xinetd is completely stopped on my server.

    Firewall is also not an issue, since I disabled it completely and tested.

    The "bind" directive in pure-ftpd.conf is by default commented and should allow all connections.

    I even removed Ftp from the VPS completely and reinstalled it again with no luck.
     
  2. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    please share your ideas so I can solve the Ftp issue...
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try connecting as a non-root user.
     
  4. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    no luck, still the same message

     
  5. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    Could you provide the output for the following:

    Code:
    lsof -i :21
    netstat -an|grep :21
    Also, if you are using iptables or anything for a firewall, please check in it for anything relating to port 21:

    Code:
    /sbin/iptables -n -L --line-number|grep :21
     
  6. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Yes, I have already checked it with lsof and netstat as well and the port is listening. And as said earlier, I even checked it by disabling the firewall.

    I can connect to my server using Ftp from outside but not from within the VPS either to localhost OR any remote server.
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try using telnet:

    Code:
    
    root@tilly [~]# telnet localhost 21
    Trying 127.0.0.1...
    Connected to localhost (127.0.0.1).
    Escape character is '^]'.
    220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
    220-You are user number 1 of 50 allowed.
    220-Local time is now 15:27. Server port: 21.
    220-IPv6 connections are also welcome on this server.
    220 You will be disconnected after 15 minutes of inactivity.
    
    Can you connect to the IP address? (i.e. ftp 127.0.0.1)
     
  8. rackaid

    rackaid Active Member

    Joined:
    Jan 18, 2003
    Messages:
    42
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Jacksonville, FL
    cPanel Access Level:
    DataCenter Provider
    Try ...

    Code:
    ping localhost
    If this fails, then I suspect a DNS issue.

    You will want to update your /etc/hosts file with:

    Code:
    127.0.0.1       localhost.localdomain localhost
    Then try,

    Code:
    ping localhost
    If it resolves, then you should be able to use your FTP.
     
  9. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    I have tried all these things before posting here :) which is why I am pulling my hairs. BTW, here's the output for you:

    BTW, ftp to anything from my server doesn't work. See:

     
  10. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    Did you try checking with tcpdump or an strace on the process when you do it?
     
  11. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    It turned out to be the /etc/services file where the port assigned to Ftp was 221.. not sure when I placed it there. But yes, as "Miraenda" suggested, strace helped to me track the issue. Thanks.
     
  12. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    Glad you were able to track it down finally. Very bizarre the port would have gotten changed in /etc/services file.
     
Loading...

Share This Page