Take the 2-minute tour ×

I started the vsftpd on Ubuntu 10.04, but can't connect to it.

The error says(FTP Client):

Status: Connecting to 124.205.xx.xx:21...
Error:  Connection timed out
Error:  Could not connect to server

I've checked the server status, and vsftpd is running:

$ ps ax | grep vsftpd
23646 ?        Ss     0:00 /usr/sbin/vsftpd
23650 pts/1    S+     0:00 grep --color=auto vsftpd

port 21 is under listening as well:

$ netstat -tlnp | grep 21
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp        0      0    *               LISTEN      - 

I can connect to localhost:

$ ftp localhost
Connected to localhost.
220 (vsFTPd 2.2.2)
Name (localhost:jlee): 
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

Here is iptables output

$ sudo iptables -vL
Chain INPUT (policy ACCEPT 191 packets, 144K 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 124 packets, 28502 bytes)
 pkts bytes target     prot opt in     out     source               destination         

What's the problem here?

share|improve this question
What does netstat -tlnp report? You just tried to list all the open udp ports with your netstat command, that can't be right... :-) –  Janne Pikkarainen Aug 26 '10 at 11:14
updated netstat command output, thanks Janne –  Johnny Aug 26 '10 at 11:22
Is 124.205.xx.xx a static or dynamic IP? –  quanta Oct 16 '11 at 9:38
Can you post tcpdump outputs from both client and server side? –  Stone Jan 23 '12 at 19:31
add comment

4 Answers

Check if your ftp client is on activ or passiv mode. If it's on passiv mode, you have to add some parameters. Something like this :

pasv_enable=YES pasv_promiscuous=NO pasv_min_port=40000 as you want pasv_max_port=41000 pasv_address=xxx.xxx.xxx.xxx (your ip) port_promiscuous=NO

share|improve this answer
add comment

I just installed vsftpd with apt-get install vsftpd on my Ubuntu 10.04 laptop, and the daemon worked out of the box.

Have you modified the vsftpd configuration files?

Does ftp localhost work for you if you try to do that on your server?

Do you have iptables enabled? Does iptables -vL list some rules?

share|improve this answer
Thanks for the answer. I've updated the output of ftp localhost and iptables -vL, please take a look at it. I used apt-get install vsftpd too, and it worked. But after a server sudden down, it doesn't work now –  Johnny Aug 27 '10 at 3:00
add comment

It's not your server firewall, it's not your vsftp configuration, it's something between you and your server =P

Can you connect from your pc to any other ftp server? Can you connect to your ftp from another host?

share|improve this answer
add comment

I am not sure but it might be apparmor daemon which might be denying you to connect it to your FTP server , disable apparmor and see if it helps

 service apparmor stop
share|improve this answer
add comment

Your Answer


