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
Pingback: vsftpd Server Problem
Pingback: vsftpd chroot errors on Ubuntu – artofsimplicity.co.uk
Mathias
Jun 17, 2013
That doesnt work for me.
root@blubb:~# /etc/init.d/vsftpd restart
Stopping FTP server: No /usr/sbin/vsftpd found running; none killed.
vsftpd.
Starting FTP server: vsftpd.
root@blubb:~# /etc/init.d/vsftpd restart
Stopping FTP server: No /usr/sbin/vsftpd found running; none killed.
vsftpd.
Starting FTP server: vsftpd.
Trent Lloyd
Jun 20, 2013
Mathias – Check your /var/log/syslog – likely you have a config error.
eigh fowr
Sep 15, 2013
Thanks so much for this! I thought I’d have to wait for 14.04 to get my vsftpd to chroot properly again, but your PPA did the trick without any trouble.
Stephen
Oct 5, 2013
I had this problem when changing from Debian 6(vsftpd 2.3.2) to Debian 7(vsftpd 2.3.5) This worked for me and no need to add new repos, please note this is for 64bit systems.
wget http://packages.debian.org/jessie/amd64/vsftpd/download
dpkg -i vsftpd_3.0.2-3_amd64.deb
echo “allow_writeable_chroot=YES” >> /etc/vsftpd.conf
/etc/init.d/vsftpd restart
Emiliano
Apr 22, 2014
Hi mark, i’m trying to add your ppa repository but always get the same error…
reportv@nagios:~$ sudo add-apt-repository ppa:thefrontiergroup/vsftpd
[sudo] password for reportv:
You are about to add the following PPA to your system:
vsftpd 2.3.5 with the allow_writeable_chroot feature backported from vsftpd 3.
More info: https://launchpad.net/~thefrontiergroup/+archive/vsftpd
Press [ENTER] to continue or ctrl-c to cancel adding it
Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 551, in __bootstrap_inner
self.run()
File “/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py”, line 99, in run
self.add_ppa_signing_key(self.ppa_path)
File “/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py”, line 132, in add_ppa_signing_key
tmp_keyring_dir = tempfile.mkdtemp()
File “/usr/lib/python2.7/tempfile.py”, line 322, in mkdtemp
name = names.next()
File “/usr/lib/python2.7/tempfile.py”, line 141, in next
letters = [choose(c) for dummy in “123456”]
File “/usr/lib/python2.7/random.py”, line 274, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
ValueError: cannot convert float NaN to integer
I’m using Ubuntu 12.04 LTS precise… could yo help me with this?
thanks a lot!
Mark
Apr 23, 2014
Hi Emiliano,
This isn’t related to the package. The “add-apt-repository” command is a Python script that is failing on your computer, and it looks like you have hit this bug:
https://bugs.launchpad.net/ubuntu/+source/pycurl/+bug/1063350
I hope that helps.
Pingback: Set-up ftp server in Ubuntu 12.04 with vsftpd, allow uploads to home folder | HolaRails
Bert
Nov 14, 2014
Now is 12.04.05 LTS and vsftp 3.0.2 and works great.
Thanks for this tip, very helpfull.
Best Regards.
CoSma Consulting
Nov 21, 2014
For Wheezy:
echo “deb http://ftp.us.debian.org/debian jessie main contrib non-free” >> /etc/apt/sources.list
aptitude update
aptitude upgrade vsftpd
echo “allow_writeable_chroot=YES” >> /etc/vsftpd.conf
service vsftpd restart
Pingback: VSFTPd stopped working after update - Popular Ubuntu Questions
Pingback: VSFTPd stopped working after update | Some Ubuntu Questions and Answers