FTP - `Name or service not know`

rflood89 picture rflood89 · May 2, 2012 · Viewed 11.7k times · Source

I have an app, on my iphone, which allows me to transfer songs too and from my linux desktop via ftp. The app indicates that the host address is 192.168.0.4 and the port to be used is 5021. I can connect fine to the device from filezilla but when I try to connect via the command line it fails with the error mentioned in the title.

The command i'm using is ftp 192.168.0.4:5021 but it fails. I'm totally stumped. When I search for help on the internet the answer is to simply do what I've done already.

Does anyone have an any idea on what to do?

Answer

Greg Hewgill picture Greg Hewgill · May 2, 2012

The ftp command does not support the :5021 syntax for port numbers. Instead, there must be another way.

With some FTP clients, you can use a -P command line option:

ftp -P 5021 192.168.0.4

With others, you need to put the port number after the host address with a space:

ftp 192.168.0.4 5021

Use man ftp to see which yours supports.