1

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

  • How did you solve this? – chaosguru Dec 14 '17 at 13:17
  • @sudharma.puranik Please don't laugh, but I installed windows into virtual machine and used FileZilla. It was the best time-effective solution. – David162795 Dec 14 '17 at 20:41
  • oh I see that was quite a detour :) – chaosguru Dec 15 '17 at 10:41
2

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

1

I had the same problem and nothing helped. not:

  1. allow_writeable_chroot=YES at vsftpd.conf
  2. chmod to the ftp root directory

    so I made a strace to the vsftpd process and saw the following lines:

...
18825 chdir("/usr/share/empty")         = 0
18825 chroot(".")                       = 0
...

after changing the permissions on /usr/share/empty with

chmod 0644 /usr/share/empty

the error was gone.

  • Hours and hours of searching, only the above helped me ... thank you! – Walid Ammar Oct 21 '18 at 22:23
  • May I ask you how did you make a strace to the vsftpd process? – Walid Ammar Oct 21 '18 at 22:24
  • 1
    strace -p <pid of the proftp process> -f – 0x0C4 Nov 6 '18 at 10:01
0
echo "allow_writeable_chroot=YES" >> /etc/vsftpd.conf && service vsftpd restart

Run the above command every time when editing conf.

  • 1
    It's a copy paste of Gilles's answer isn't it? – Sylvain Pineau Jul 21 '16 at 12:05

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.