Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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,051
    Likes Received:
    2
    Trophy Points:
    168
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,051
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Earth
    please share your ideas so I can solve the Ftp issue...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,565
    Likes Received:
    43
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Try connecting as a non-root user.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. madaboutlinux

    madaboutlinux Well-Known Member

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

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    243
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    Coralville, Iowa USA
    cPanel Access Level:
    Root Administrator
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,051
    Likes Received:
    2
    Trophy Points:
    168
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,565
    Likes Received:
    43
    Trophy Points:
    308
    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)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. rackaid

    rackaid Active Member

    Joined:
    Jan 18, 2003
    Messages:
    42
    Likes Received:
    1
    Trophy Points:
    158
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,051
    Likes Received:
    2
    Trophy Points:
    168
    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:

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    243
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    Coralville, Iowa USA
    cPanel Access Level:
    Root Administrator
    Did you try checking with tcpdump or an strace on the process when you do it?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,051
    Likes Received:
    2
    Trophy Points:
    168
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    243
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    Coralville, Iowa USA
    cPanel Access Level:
    Root Administrator
    Glad you were able to track it down finally. Very bizarre the port would have gotten changed in /etc/services file.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice