Problem with vsftpd - "553 Could not create file"


9 posts
by MrMarkus » Mon Dec 24, 2012 11:07 am
Hi all,

Does anyone have any thoughts on why I can't ftp a file to my Pi using vsftpd?

I can browse folders, ftp files off the Pi but when I try to ftp to the Pi I get a response: "553 Could not create file, critical file transfer error"

I'm running the Rasbian Wheezy O/S, probably from one of the first releases as it was a few months ago that I downloaded it.

I've modified vsftpd.conf to set write_enable = yes & local_enable = yes, I can't see any other areas of the config that might be preventing writes.

I've tried the latest version of filezilla on my win7 machine, and "ftp" from the win7 command line - both fail in the same way so I think it's somethign with vsftpd or the Pi / O/S.

I'm trying to test the first PiXi-200 prototype (please see my other posts if you're interested) and need a means of getting an FPGA configuration file into /home without logging in to the Pi itself. FTP seemed the easiest way of doing this... I know vsftpd should work but i'm Linux novice so I'm going to plead ignorance here and shout for help

Many thanks,

Mark
Posts: 28
Joined: Sat Sep 22, 2012 9:07 am
by joan » Mon Dec 24, 2012 11:37 am
A permission error is quite likely.

Where are you trying to place the file on the Pi? How big is it? Are you the same user on the remote machine and the Pi?
User avatar
Posts: 4214
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by MrMarkus » Mon Dec 24, 2012 1:00 pm
Hi Joan, thanks for your reply,

Permissions is what I was thinking too so i'm glad to hear someone else has the same thought.

I'm trying to place a 123kB file into a subfolder within /home, "/home/pixi/" to be more precise.

I've tried smaller files, they also fail.

I've tried placing a file in /home & /usr/mark and both fail. For safety reasons, not wishing to mess anything up, i'm trying not to put files in places i'm not familiar with.

The Pi usually has no users logged in but i've tried the same transfer while logged in as pi / raspberry which is the same as the username & password entered on the ftp client but that also fails. I had assumed that my user id on my win7 machine had nothing to do with is and shouldn't affect ftp transfers at all but that's only a guess...

/home & /usr should be open to ftp shouldnt they?

Is there a more open folder or location I could try to upload a file to?

Thanks & best regards,

Mark
Posts: 28
Joined: Sat Sep 22, 2012 9:07 am
by caldimerda » Mon Dec 24, 2012 1:15 pm
Hi

I'm using vsftpd on my FileServer / Webserver pi - with an external disk and Lighttpd.

Did you set the vsftpd user? I have mine using an account "ftpuser" with a group "ftpuser"and the ftpuser's home dir is on the external hard disk. Then make sure the account you use when ftp'ing into the pi is a member of the "ftpuser" group and has rights to write to the directory (or subdirectory).

regards, caldimerda
Posts: 20
Joined: Tue Oct 09, 2012 9:41 am
by MrMarkus » Mon Dec 24, 2012 2:13 pm
caldimerda wrote:Hi

Did you set the vsftpd user?...


I think you're on the right track there - thanks.

I tried putting the file into the folder presented in the ftp client after the connection was established (/home/pi) and that worked.

So I need to add a user called pixi now... either that or i can work from the pi folder which isn't really a problem.

Can I ask how I might go setting up a new user and password on the vsftpd sever?

Many thanks,

Mark
Posts: 28
Joined: Sat Sep 22, 2012 9:07 am
by caldimerda » Mon Dec 24, 2012 3:52 pm
I'm really sorry I may have misled you in my last post. I got 5 minutes into walking the dog just now and realised I had wasn't clear that "ftpuser" is the account I used to actually connect perform the ftp. I think you worked it out in spite of what I wrote.

I think any user can authenticate - ie. connect - via vsftpd. But I have the chroot_local_user set to NO which I believe limits my users to accessing their own home directories. In the past - not on my Raspi - if I was systematically ftp'ing in files used by other processes, then I had a script running as a daemon that did a bit of file authentication before copying the files to their intended destination. That way partial transfers and ascii instead of binary or other corruption hopefully won't cause a problem.

I think that allowing ftp users to stray outside their home directory is normally frowned upon.
Posts: 20
Joined: Tue Oct 09, 2012 9:41 am
by Unhban » Mon Dec 24, 2012 5:09 pm
The grey cells started stirring from their slumber when reading about this. I too have loaded vsftpd recently and read somewhere that I should make two changes in the /etc/vsftpd.conf file. These may or may not relate to your problem though.... :oops:

Uncomment the following
Code: Select all
local_enable=YES
write_enable=YES

I believe that after these changes vsftpd makes /home/pi the directory that you enter into when ftping in....
Hope this helps.
Unh.
Posts: 53
Joined: Sun Oct 14, 2012 10:58 am
by stevhorn5 » Mon Dec 24, 2012 6:54 pm
In your vsftpd.conf file find the following entries and change as shown below:

Code: Select all
chown_uploads=YES
chown_username=pi
chroot_local_user=YES
chroot_list_file=/etc/vsftpd.chroot_list


Save and exit.

In Terminal create the following file

Code: Select all
sudo nano /etc/vsftpd.chroot_list


with "pi" (without quotes) as the only entry

Save everything and reboot
Posts: 116
Joined: Wed Jul 04, 2012 5:47 pm
Location: Ontario, Canada
by MrMarkus » Wed Jan 16, 2013 11:19 am
Hi everyone,

Firstly, my appologies for not replying sooner, i've missed a pile of emails and all sorts of things to do relating to the Pi and the PiXi-200 over the Christas period, i'm only just 'recovering'.

Thankyou to every one who responded, it was found to be a permissions thing in the end. As a novice with Linux i'd think I messed something up by creating a folder under /home and then adding a user with the same name so I think it failed to completely add the new user properly because the user folder under /home already existed.

So I made a fresh start from a blank Raspbian installation and went through it all again, taking in everything everyone had said here and it worked first time.

Many thanks to all :)

Best regards,

Mark
Posts: 28
Joined: Sat Sep 22, 2012 9:07 am