At The Frontier Group, we use vsftpd with chrooted users for clients that require FTP access. It has been working well for four years, however after a recent upgrade to Ubuntu 12.04 we started receiving this error message:
500 OOPS: vsftpd: refusing to run with writable root inside chroot ()
Ben Scobie has a good overview of the problem. One solution is adding the following to your vsftpd config file:
allow_writeable_chroot=YES
Unfortunately vsftpd 2.3.5, which is packaged in Ubuntu 12.04, doesn’t support this feature. It is only available in vsftpd 3 onwards.
As an alternative solution, we have backported it from vsftpd 3 into Ubuntu’s 2.3.5 package and made it available as a vsftpd PPA on Launchpad. To use it, run the following:
sudo add-apt-repository ppa:thefrontiergroup/vsftpd
sudo apt-get update
sudo apt-get install vsftpd
Update (31 Jan 2013): @JeyeNooks has backported the feature to Ubuntu 12.10, and has uploaded his package here.
Erik Norman
Nov 6, 2012
I tried adding the repository, but I get the following error message:
W: Failed to fetch http://ppa.launchpad.net/thefrontiergroup/vsftpd/ubuntu/dists/quantal/main/source/Sources 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/thefrontiergroup/vsftpd/ubuntu/dists/quantal/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Mark
Nov 8, 2012
Erik, you’re getting that error because the PPA was built for Ubuntu 12.04 (precise) and you are using 12.10 (quantal).
aten
Nov 11, 2012
I have runned those steps but it says when i run last step “sudo apt-get install vsftpd” :
Reading package lists… Done
Building dependency tree
Reading state information… Done
vsftpd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.
Im using ubuntu 12.04 precise LTS
aten
Nov 11, 2012
Update: this finnally worked for me:
1. backup /etc/vsftpd.conf file
2. dpkg –remove vsftpd
3. sudo apt-get install vsftpd
4. copied conf file back
Last note: THANK YOU
ismaail E.G.
Nov 12, 2012
if you don’t have “add-apt-repository” command in the server,
install this:
sudo apt-get install python-software-properties
Vince
Nov 30, 2012
Thanks :) This fix my problem :) can’t update to the last vsftp version package of ubuntu 12.04
Pekka
Dec 10, 2012
Thanks, now my ftp server works like it should :)
Andy
Dec 15, 2012
Thanks! After hours of going around in circles this fixed my problem!
When using SSL (FTPS) it also fixes the “GnuTLS error -15: An unexpected TLS packet was received.” error seen in Filezilla on Ubuntu.
Alain
Dec 25, 2012
Thanks! Good job!
Anton
Jan 13, 2013
Hey Mark,
I was wondering , since you said this PPA is only for 12.04, have you got maybe any idea how to fix this on 12.10? We HAVE to use 12.10 for school, so downgrading is not an option for me… any ideas?
Kind regards
Anton Vandeghinste
Mark
Jan 14, 2013
Hi Anton,
It is probably easiest to grab the source package for my PPA, and extract the patch that backports the writable root functionality (it is in the file vsftpd-2.3.5/debian/patches/11-allow-writeable-root.patch). Then add that patch to the Ubuntu 12.10 source package and compile it. It’s the same version of vsftpd so there is a good chance that the patch will apply cleanly.
I think you’d get bonus Internet Points if you also created your own PPA using the instructions on the Ubuntu wiki. It’s a bit of work to get going, but you learn quite a bit during the process and you can share it with others easily.
AndyG
Mar 11, 2013
Thank you so much. I’d not tried setting up an ftp server before and was going nuts wondering why I couln’t get chroot to work correctly on Precise. Especially when I found so many post describing how it’s done… and then it didn’t work for me. I can now relax and enjoy my coffee :)
Pingback: vsftpd unter ubuntu 12.04 einrichten | Open learning
9000birds
Mar 20, 2013
Thank you so much, finally my problem solved.
Pingback: ติดตั้ง vsftpd ด้วย ubuntu 12.04 writable chroot
Rafael
May 14, 2013
Hi all,
I faced the same problem using Ubuntu 12.10, and during my debugging process I found this .deb already patched for Ubuntu 12.10.
http://blog.desertbushtech.com/2013/02/i-use-ubuntu.html
I hope this also helps other 12.10 users :).
OwN-3m-All
May 17, 2013
Here’s the 32-bit patched version for Ubuntu 12.10:
http://dinofly.com/files/linux/vsftpd_2.3.5-3ubuntu1_i386.deb
And a mirror of the 64-bit version for Ubuntu 12.10:
http://dinofly.com/files/linux/vsftpd_2.3.5-3.jme_amd64.deb