2

I have tried many answers but I was unable to make ftp work on my ubuntu 14.04.ftp works with localhost but not with other ip's

Whenever I try to use

>ftp <ip-address>

I get this error

ftp: connect: Connection refused

I have installed ftpd and ftpd this is output of

dpkg -l | grep 'ftp'

ii  ftp                                                   0.17-28                                             amd64        classical file transfer client
ii  ftpd                                                  0.17-34                                             amd64        File Transfer Protocol (FTP) server
rc  vsftpd                                                3.0.2-1ubuntu2.14.04.1                              amd64        lightweight, efficient FTP server written for security

Also This is the output of

iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

output of

netstat -l | grep ftp

tcp        0      0 *:ftp                   *:*                     LISTEN     

Please help me!

Null pointer
  • 2,527
  • 5
  • 25
  • 38
  • 1
    Do you want to connect to a remote server or you want to allow ftp connections to your machine? – Nabeel Jul 06 '14 at 12:53
  • Do you know of an ftp server which is certain to work (ie, it work on another system in the same LAN as your system)? Could you try with such a server? – muru Jul 06 '14 at 13:35
  • actually I am trying to connect to my friends laptop..both laptops are in same network even my friend can ftp to my laptop but I cant! – Null pointer Jul 06 '14 at 17:00
  • Have you checked if ftp server is installed? of is it running? try to run this command dpkg -l | grep -i ftp tell me whats the result – TeddyKode Jul 06 '14 at 12:49

1 Answers1

3

Check to see if the ftp server is running:

ps aux | grep ftp

If not, see if you can start/stop or restart the service:

sudo service ftpd stop && sudo service ftpd start

Or:

sudo service ftpd restart

You can also check to see whether ftpd is listening on the correct port:

netstat -l | grep ftp

The output should show ftpd listening on port 21 (standard ftp port).

Eliah Kagan
  • 116,445
  • 54
  • 318
  • 493
Andrew
  • 595
  • 3
  • 7
  • netstat output added to question! – Null pointer Jul 06 '14 at 17:01
  • Also `sudo service ftpd restart` says ftpd:unrecognised service – Null pointer Jul 06 '14 at 17:13
  • It appears as though the suggested means of running an FTP server on Ubuntu, is to use either vsftpd - http://askubuntu.com/questions/323868/how-do-i-install-a-ftp-server - or proftpd http://www.server-world.info/en/note?os=Ubuntu_14.04&p=ftp&f=2 – Andrew Jul 06 '14 at 20:27
  • The output of `dpkg` shows that `vsftpd` was installed at one stage, but removed ('rc') ... did you try and follow one of the other guides? – Andrew Jul 06 '14 at 20:54
  • the answer given in the link doesn't work for me...I think something else is causing this problem.. Check my output of `netstat` looks weird! – Null pointer Jul 07 '14 at 05:29
  • I'm not quite sure how the daemon in the standard `ftpd` package is meant to be running, but the output is correct - it shows that a process called `ftpd` is listening globally (`*.*`) on the standard ftp port. To confirm this, you can add the -n flag to netstat - `netstat -ln` - and this should show port 21 listening. – Andrew Jul 07 '14 at 07:38
  • From my own experience, you're better of using proftpd, since it's a trusted and proven product. It will also allow you to use `sftp`, which uses ssh under the hood, and is far more secure than standard ftp, which is generally known as insecure (partly because it uses plaintext for data transfer) – Andrew Jul 07 '14 at 07:40