Error message "500 OOPS: vsftpd: refusing to run with writable root inside chroot()" - keep user jailed
For VSFTPD 3,
- Go to:
/etc/vsftpd.conf
and add this:
allow_writeable_chroot=YES
Just add it if it does not exist yet.
Restart the vsftpd service:
service vsftpd restart
And it should work.
The real solution of this problem: the home folder of the user should not be writable only readable.
So, if user site is in the folder is cat/example.com/http/
, folder cat
must have chmod 555
and all will be OK.
After further review of this post, in the comments a package was posted that fixed my issue. You can search for it by either my name or "Marks" Documentation: http://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/. Here are my details of how I fixed this further.
USERS ARE STILL JAILED TO THEIR HOME DIRECTORIES!!!
# ------------------------------------------------------------------------------
# SETUP FTP USERS --------------------------------------------------------------
# ------------------------------------------------------------------------------
# create the ftp users and lock them to the website directories
useradd -d /srv/www/[website/appname] -m [ftp user name]
# set the ftp account passwords
passwd [ftp user name]
# add the ftp users to the www-data user/group
adduser [ftp user name] www-data
# BUG FIX: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
sudo add-apt-repository ppa:thefrontiergroup/vsftpd
sudo apt-get update
sudo apt-get install vsftpd
# Edit the vsftpd.conf and append this setting to the end of the file to keep users' jailed!
nano /etc/vsftpd.conf
# add all of the text between the starting [[ and ending ]]
# [[
# Keep non-chroot listed users jailed
allow_writeable_chroot=YES
# ]]
# restart the service for changes to take effect
sudo service vsftpd restart
#test ftp via secondary terminal window:
ftp [ftp user name]@[server ipaddress] [ftp port]