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

ftppermissionsvsftpd

I am fully aware this question was asked countless times, but no solution mentioned before worked for my case.

My config:

$ cat /etc/vsftpd-anon.conf 
listen=YES
local_enable=NO
anonymous_enable=YES
write_enable=YES
anon_root=/var/anonftp
xferlog_enable=YES
listen_address=10.0.0.2
listen_port=9988
allow_writeable_chroot=YES

See, I am not using any home directory things. There is this one directory I created especially for this case. I also added allow_writeable_chroot option and vsftpd recognizes it, but IGNORES IT.

target directory:

$ ls -l /var/ | grep anonftp
drwxrwxrwx  3 root root      4096 led 26 11:09 anonftp

How I try to use it:

$ sudo killall vsftpd 
$ sudo vsftpd /etc/vsftpd-anon.conf &
[1] 21064
$ ftp 10.0.0.2 9988
Connected to 10.0.0.2.
220 (vsFTPd 3.0.2)
Name (10.0.0.2:david): anonymous
331 Please specify the password.
Password:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Login failed.

Nothing in vsftpd.log

Best Answer

Run echo "allow_writeable_chroot=YES" >> /etc/vsftpd.conf && service vsftpd restart