Q: can not ftp localhost but can ftp from remote server I have installed vsftp to the server , the status is running now , but when use the command ftp localhost , it pops the 421 Service not available. , would advise what is wrong ? thanks
bash-3.2# /etc/rc.d/init.d/vsftpd status
vsftpd (pid 580) is running...
bash-3.2# ps -ef |grep vsftpd
root 580 1 0 15:44 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root 607 467 0 15:45 pts/0 00:00:00 grep vsftpd
bash-3.2# ftp localhost
Connected to localhost (127.0.0.1).
421 Service not available.

the below is the output , would advise what can I do ? thanks
bash-3.2# netstat -tanp |grep ftp

tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 3205/vsftpd
bash-3.2# ps -ef |grep ftp
root 3205 1 0 Feb02 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root 6075 5626 0 21:35 pts/0 00:00:00 grep ftp


bash-3.2# /sbin/iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
bash-3.2# /sbin/chkconfig --list |grep ip
all iptables are off


A: There is a parameter called tcp_wrappers=YES in vsftpd.conf. And it checks your hosts.deny file under /etc. You can change tcp_wrappers=NO or you can check your hosts.deny file under /etc

A: bash-3.2# ftp localhost
Connected to localhost (127.0.0.1).
421 Service not available.

It looks like you can connect, that is the server listens to this address (like you see with netstat too) and there are no iptables rules which block the connection.
Instead the server itself refuses to serve you. Therefore you need to look at the server logs and server configuration for help. Maybe you should look at the tcp_wrappers option and the related configuration in /etc/hosts.allow etc.
