# cannot upload files to ftp server(vsftpd)

## Adel Ahmed

here's my configuration file:

anonymous_enable=YES

anon_root=/media/

write_enable=YES

anon_upload_enable=YES

anon_mkdir_write_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

listen=YES

I mounted ftp using curlftpfs and fstab:

curlftpfs#pc            /media/pc       fuse            allow_other,uid=1000,gid=1000   0 0

whenever I try to copy or mkdir I get the following:

cp: cannot create regular file ‘./Unsaved Document 1’: No such file or directory

mkdir: cannot create directory ‘test’: Operation not permitted

journalctl has nothing to say:

Apr 12 14:32:24 localhost systemd[1]: Started Vsftpd ftp daemon.

but then again I haven't really configured journalctl.

thanks

----------

## gerdesj

First thoughts:

Best not to use /media for ftproot - it's used by some auto mounters for CDs/DVDs/USB

What user is your ftp daemon running as? #ps aux | grep ftpd and does it have permissions for the ftproot directory?

Cheers

Jon

----------

## Adel Ahmed

root      1281  0.0  0.0   8528   600 ?        Ss   21:04   0:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

I think the new automount partition is /run/media

I never had anything mounted under /media

----------

## gerdesj

I've got some vsftpds running somewhere.  I'll have a look for them tomorrow am and send you some better ideas.  I'm running on GMT+1  (BST)

I'd still recommend creating something like /var/lib/ftp or /srv/ftp - it's where that sort of thing belongs.

Oh what the heck - I'll probably need an ftp daemon on my laptop one day - engaging emerge ....

Cheers

Jon

----------

## Adel Ahmed

thanks

I appreciate your help

----------

## Adel Ahmed

help anyone?

----------

## pa4wdh

I also use vsftpd, and from your configuration i can't see if you're actually using anonymous ftp.

In case you do, vsftpd's behavior recently changed. Now it doesn't allow anonymous write access to it's ftp root, no matter what permissions you have on the filesystem. It might even refuse to work when the ftp root is world writable. I ended up creating a directory "upload" within the ftp root and made that world writable.

Maybe this works for you too ?

----------

## Adel Ahmed

well, local user ftp works fine here are the lines I added to the config:

local_enable=YES

local_root=/media/raid

and my new fstab line:

curlftpfs#pc            /media/pc       fuse            noauto,allow_other,uid=1000,gid=1000,umask=022,user=adel:<password>       0 0

where <password> is adel's password

thanks pa4wdh

----------

