1

I'm trying to send a file using ftp command line. It's working in my laptop by not in my vps server.

ftp -v -n <<EOF
open ftp.myserver.com
user username password
cd /folder/
put file.csv
EOF

I'm using a VM under proxmox running: debian 8, webmin and csf firewall. Don't know if it's blocked from the guest or host server.

This is the output of the command:

Connected to ftp.myserver.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 500 allowed.
220-Local time is now 16:57. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
331 User username  OK. Password required
230-Your bandwidth usage is restricted
230-OK. Current restricted directory is /
230 1394 Kbytes used (0%) - authorized: 153600000 Kb
Remote system type is UNIX.
Using binary mode to transfer files.
250 OK. Current directory is /folder
local: file.csv remote: file.csv
200 PORT command successful
425 Could not open data connection to port 48412: Connection timed out
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
lloiacono
  • 193
  • 1
  • 7
mbouzahir
  • 77
  • 10
  • Looks like you are using Active FTP mode, so maybe your VPS doesn't allow connections back to it from the FTP server on the port range used – Phil May 22 '17 at 15:26
  • I am using VM proxmox what can do to fix it? – mbouzahir May 22 '17 at 15:36
  • I'm not familiar with ProxMox but I suggest you spend some time to understand the difference between Passive and Active FTP and how they work w.r.t. NAT – Phil May 22 '17 at 17:27
  • it would be great if you could test the server and share the results link using [FTP Online Tester](https://ncomputers.org/ftptest) – ncomputers May 23 '17 at 04:09
  • No i can't put my ftp credentials in an online tool. the output is in the question no need for any online tool. – mbouzahir May 23 '17 at 22:59

1 Answers1

0

I fixed my issue by running this commande in the host server

modprobe ip_conntrack_ftp

than i added ip_conntrack_ftp to /etc/modules file (so it works after restart)

mbouzahir
  • 77
  • 10