Linux – I can ssh and sftp to the server, but ncftp doesn’t work

ftplinuxsftp

In addition to what's stated in the title, I'm also able to ncftp successfully into a different server. But on server A, I get this

Could not connect to xxx.xxx.xxx.xxx — try again later: Connection
timed out.

indefinitely. These are Ubuntu 10.04, 64-bit servers. Is there some server-side setting I need to change on the server A to get it to work? (And if anyone's wondering, I need ncftp because it lets me upload a directory with subdirectories, whereas with (s)ftp there is apparently no way to do this.)

Best Answer

Both ssh and sftp connects using the ssh daemon on the remote host, using port 22/tcp while FTP is an entirely separate protocol/service, using other port(s). To allow ncftp to work you have to make sure that the remote server uses a properly configured FTP daemon (such as proftpd, vsftpd, ncftpd) and that no firewall policies block in/outgoing access on either of the machine you are connecting from, or the server.

In your case you probably want to use scp, another utility in the ssh toolbox. It allows you to recursively copy directories over ssh. Just use this syntax:

scp -r folder/ user@remote.host:

It will recursively copy the folder named folder to the user account user on remote.host. Its important to include the : after the hostname, its how scp expects to see it, otherwise it will attempt to copy the folder into a file called user@remote.host on your source/local computer.

You can also use scp to copy single files, ofcourse.

Related Topic