5

Even on localhost using the ftp command, through the web server on WordPress, on my personal computer through FileZilla, in short, I need my FTP server but it refuses to let anyone connect.
Using SFTP works perfectly, but even when I enable SSL on vsftpd which I think is the same thing, it still doesn't work.
I've followed many tutorials on how to set it up, tried wiping my server multiple times, nothing works.

Using netstat -tlpn returns this result, it seems the process is running but is not listening, even though in the config file listen is set to YES.

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      9563/mysqld     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      972/sshd        
tcp6       0      0 :::58623                :::*                    LISTEN      25429/java      
tcp6       0      0 :::49505                :::*                    LISTEN      25429/java      
tcp6       0      0 :::80                   :::*                    LISTEN      22955/apache2   
tcp6       0      0 :::8080                 :::*                    LISTEN      25429/java      
tcp6       0      0 :::22                   :::*                    LISTEN      972/sshd
Wargog
  • 309
  • 3
  • 4
  • 12
  • Could you paste the exact error message that is being shown while trying to connect to the server for ftp? Are all sources getting the same message? – heemayl Nov 04 '14 at 16:33
  • All attempted connections are getting the error message: connect: connection refused – Wargog Nov 04 '14 at 16:59
  • Have you checked that your ftp server is actually listening on port 21 or any other configured port by netstat or ss or lsof or any other method? – heemayl Nov 04 '14 at 17:33
  • No, thats not the command you should be using. Use netstat -tlpn or ss -antu or sudo lsof -i:21 and post the output of any one of them preferably netstat -tlpn and remove your last edit. – heemayl Nov 04 '14 at 18:16
  • Updated, sorry, I added my thoughts as well. – Wargog Nov 04 '14 at 18:25
  • 1
    Thats exactly what i expected. Your vsftpd is not listening at all. You can be sure that whether the process is actually running or not by using the command ps -ef | grep -i "ftp" or pgrep -l "ftp". – heemayl Nov 04 '14 at 18:29
  • root 23290 23209 0 18:30 pts/0 00:00:00 grep --color=auto -i ftp It is definitely running, but not listening. – Wargog Nov 04 '14 at 18:31
  • No man, Its definitely not running. Just check the command at the last column, it says grep --color=auto -i ftp which is the command you just gave, right? Nothing else is running which has the pattern "ftp" in it.So, in a nutshell you vsftpd is not running most possibly due to a configuration related issue. – heemayl Nov 04 '14 at 18:35
  • I have just added an answer based on our discussion. Follow the links to get a better idea on vsftp setup procedure. You could just select my answer as the answer to your question as it serves the primary issue, if you have any further query regarding setting up vsftpd you should ask a new question but i think if you just follow the links you can set it up by yourself. – heemayl Nov 04 '14 at 18:49

3 Answers3

5

The vsftpd service is not running and hence is not listening on port 21 or any preconfigured port. As a result you are getting the connect: connection refused error message every time while using an FTP client to connect to the server. I think you should check the setup procedure and configuration files for sorting out the issues. This and this might be a very good place to start.

guntbert
  • 13,134
heemayl
  • 91,753
2

This actually turned out to be that SSH SFTP was somehow running on 21 instead of 22. So, if anyone is having the same issue, trying connecting through an SFTP client instead of plain old FTP, still using port 21

Wargog
  • 309
  • 3
  • 4
  • 12
0

Check your vsftpd.conf file for duplicate entries.

If there's two times the same thing, it would simply not start correctly.

Check:

/etc/vsftpd.conf

for lines that are properties entries that are duplicated.

damadam
  • 2,833
MikeJT
  • 1
  • 1