FTP Not Working - Help Please!

Dodi300

Member
Jul 1, 2009
12
0
51
Hello. Two days ago my FTP was working fine, however I got an email from a client saying that he receives the message:
"A connection with the server could not be established"

I tried to log in and I receive that message as well.
I've tried restarting the FTP server and also changing the config options in WHM.
Nothing seems to work.

Does anyone know whats wrong?
Any log files I can look at to see the problem?

Thanks for the help. :)
 

logicsupport

Well-Known Member
Jun 5, 2007
138
0
166
Hello,

Seems that its a firewall issue. Try this again after disabling firewall.

Also confirm all the ftp modules are loaded properly using the following command.

lsmod | grep ftp
 

Dodi300

Member
Jul 1, 2009
12
0
51
The firewall is not enabled.
Also I ran that command, but nothing happened.
I didn't get an error or anything.

Are there any log files for the FTP?
By the way, I'm using Pure-FTPD.

Thanks!
 

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
You can check the FTP logs from the below mentioned location from SSH.

pico /var/log/messages
 

logicsupport

Well-Known Member
Jun 5, 2007
138
0
166
If you are not in a vps , then you can enable the ftp module using the following two commands.

modprobe -r ip_conntrack_ftp

modprobe ip_conntrack_ftp

Restart the ftp server

/scripts/restartsrv_pureftpd

Ftp log :

tail -f /var/log/xferlog

If you are still facing issue you need ask help from any system administrators
 

Dodi300

Member
Jul 1, 2009
12
0
51
From the logs it looks like I can login but then it logs me back out again.
There's no errors or anything.

I'll open a ticket.

Thanks for the help! :)
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Are you using "passive mode" in your FTP program when you connect?

Many firewalls will interpret outgoing FTP connections as incoming hacking attacks if you fail to set your FTP program on your home computer to use "Passive Mode" and will block your connection right after you connect.

Incidentally, this originates from the firewall on your own computer at home instead of the firewall from the server.

EDIT: I forgot to mention yesterday that you will need to open your Firewall on your server for "Passive Mode" if you are using CSF or APF (or similar) and will also need to setup your FTP server use it. If you don't do this on the server to allow for passive mode or fail to setup your FTP client at home to use the same then you will likely keep getting disconnected by the firewall that is on your home computer. (Instructions with CSF follow):

Code:
# cd /etc/csf
# pico ./csf.conf      [i](or vi ./csf.conf)[/i]

Add the following in-line to your TCP_IN Line:          [b]30000:35000[/b]

# cd /etc
# pico ./pure-ftpd.conf

Add the following to your FTP server configuration

[b]PassivePortRange        30000 35000[/b]

# service csf restart
# service pure-ftpd restart
With your FTP server accepting "PASSIVE MODE" connections and your home FTP client software utilizing "PASSIVE MODE", you should no longer get disconnected by your home computer firewall anymore! ;)
 
Last edited:

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
Hi,

Please post the logs here..also provide the ping and tracert report from the system in which you are facing the issue to connect with server for FTP service.