500 OOPS: vsftpd: refusing to run with writable root inside chroot()

500 OOPS: vsftpd: refusing to run with writable root inside chroot()

Today I was configuring the vsftp server in Ubuntu 12.04 LTS with chroot enable. But I stuck with issue even I enable the “chroot_local_user=YES ” in /etc/vsftpd.conf

Error:500 OOPS: vsftpd: refusing to run with writable root inside chroot()

To solve this issue ,I installed the latest package and add one more parameter in /etc/vsftpd.conf
Below are the steps of the solution-

(1) Download the latest vsftpd deb package from the repository as per your operation system architecture.I am using the i386 hence I have downloaded the package for i386 and install it
Login into server and become a superuser root.

$sudo su –
#cd /root
#wget http://security.ubuntu.com/ubuntu/pool/main/v/vsftpd/vsftpd_3.0.2-1ubuntu2_i386.deb
#dpkg -i /root/vsftpd_3.0.2-1ubuntu2_i386.deb

(2) Enable two parameters in /etc/vsftpd.conf

chroot_local_user=YES
allow_writeable_chroot=YES (note this option you have to write yourself in /etc/vsftpd.conf file)

(3) Now restart the vsftpd service.

service vsftpd restart

For reference purpose given below is my complete /etc/vsftpd.conf configuration.
Even if you only write the given below contents as it is in /etc/vsftpd.conf file it will work , 🙂

root@ubuntu:/# cat /etc/vsftpd.conf
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
allow_writeable_chroot=YES
root@ubuntu:/#

2 thoughts on “500 OOPS: vsftpd: refusing to run with writable root inside chroot()”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.