Find us on facebook

Jul 1, 2015

FTP Connection refused error

Verify that ftp server installed:

Debian Linux
$ dpkg -l | grep -i "ftp"
Output:
ii  ftpd                           0.17-21                       FTP server

OR:
$ dpkg -l | grep -i ftp

Red Hat/Novell Suse/Fedora Linux:
# rpm -qa | grep -i "*ftp*"

If you have the ftp package installed it will return output. If the ftp package is not installed, it will notify or not give any output. If not installed, Install FTP server.

Red Hat/Fedora Linux install vsftpd server :
# up2date vsftpd

Fedora Linux:
# yum install vsftpd

Debian Linux:
# apt-get install vsftpd

Next configure vsftpd by modifying /etc/vsftpd.conf file.

Is ftp server running (is port 21 open)?
Login to server using ssh and telnet port 21 (to see port is open or not):
$ telnet localhost 21

Next run netstat -tulpn command to see if port 21 is in open:
$ netstat -tulpn | grep :21

Output:
tcp        0      0 0.0.0.0:21             0.0.0.0:*               LISTEN

OR :
$ netstat -a | grep ftp
Output:
tcp        0      0 *:ftp                   *:*                     LISTEN

If port is not open, start ftp server /service.
RedHat/Fedora Linux :
# service vsftpd start

Debian Linux:
# /etc/init.d/vsftpd start

FTP user permissions
File /etc/ftpusers - list of users disallowed use vsftpd server access.

Security or Firewall
Check iptables firewall/tcpd does not block access to ftp server. Run following command on ftp server
# iptables -L -n

Use iptables rules to open port 21. Make sure file /etc/hosts.deny (TCPD wrappers) does not block access to port 21 for your ftp host.

No comments:

Post a Comment