Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'v allowed FTP ports 21 and 20 which then allows me to connect to my FTP server via "ftp" command, but I still can't get curlftpfs to work.

What ports does curlftpfs all use? Or is their something else I have to do with iptables to allow curlftpfs?

curlftpfs -v /ftp1/ -o user=user:pass

I get this in the log when I try to do "ls -l" in /ftp1/

I uploaded the log to that site since it would look very messy here

I use these rules to allow FTP:

iptables -A INPUT -p tcp --sport 21 -j ACCEPT
iptables -A INPUT -p tcp --sport 20 -j ACCEPT
share|improve this question
up vote 3 down vote accepted

It looks like curlftpfs is using pasv mode. You need to either force active mode, or modprobe ip_conntrack_ftp to allow pasv connections through.

To force active mode:

curlftpfs -oftp_port=- /mnt/my_ftpfs_mountpoint

Make sure your firewall also accepts both incoming and outgoing traffic on port 20. Port 21 is outgoing only.

share|improve this answer
How would I force active mode with curlftpfs? (I looked though the man page but they don't say) Also how would doing 'modprobe ip_conntrack_ftp' help? It's a firewall issue I though... since when I allow everything though the firewall it works. – Mint May 21 '10 at 23:48
BTW I ran 'modprobe ip_conntrack_ftp' but it doesn't change anything – Mint May 21 '10 at 23:49
@Mint: From the man page ( use the -o ftp_port=$server_address option. also one of the two modprobe's (mine and Warner's) should have worked what distro are you on? – Zypher May 21 '10 at 23:54
Im using Debian Lenny – Mint May 21 '10 at 23:56
huh, weird, i don't have a debian system, but works fine on my ubuntu boxes. Check your IPTABLES rules against the ones here: – Zypher May 22 '10 at 0:02

The ip_nat_ftp kernel module needs to be loaded if support is not compiled into the kernel.


/sbin/modprobe ip_nat_ftp

share|improve this answer
No that didn't fix it, I put a log of the firewall while I tried to connect – Mint May 21 '10 at 23:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.