The following error can occur when you just installed vsftpd on a Linux server and trying to FTP to it.
Command: USER xxx Response: 331 Please specify the password. Command: PASS ****************** Response: 500 OOPS: vsftpd: refusing to run with writable root inside chroot() Error: Critical error: Could not connect to server
This is caused by the fact that the directory of the user you’re connecting to, is write-enabled. In normal
chroot() situations, the parent directory needs to be read-only.
This means for most situations of
useradd, which will create a home directory owned and writeable by the user, the above error of “vsftpd: refusing to run with writable root inside chroot()” will be shown.
To fix this, modify the configuration as such.
$ cat /etc/vsftpd/vsftpd.conf ... allow_writeable_chroot=YES
If that parameter is missing, just add it to the bottom of the config. Next, restart vsftpd.
$ service vsftpd restart
After that, FTP should run smoothly again.
Alternatively: please consider using sFTP (FTP over SSH) or FTPs (FTP via TLS) with a modified, non-writeable, chroot.