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

  • Posted July 27, 2013

I have installed vsftpd on my Ubuntu 12.04 x32 I have set up vsftpd.conf and uncommented local_enable=YES and write_enable=YES and chroot_local_user=YES (both of them).

I had already installed apache server in /home/var/www/

so I did a chown root:root /var/www/

When I try to login with the root username and password to the ftp server. I get the error vsftpd: refusing to run with writable root inside chroot()


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I’v added allow_writeable_chroot=YES to the end of the vsftp.conf file, located on /etc/

Since you’re chrooted to /home/snitz, move /var/www/* to /home/snitz/www/* so that you can edit the files.

The Ubuntu Server Guide suggests:<br /> <br><h3>Sharing Write Permission</h3> <br><blockquote>For more than one user to be able to write to the same directory it will be necessary to grant write permission to a group they share in common. The following example grants shared write permission to <b>/var/www</b> to the group <b>webmasters</b>.</blockquote> <br><pre>sudo chgrp -R webmasters /var/www <br>sudo find /var/www -type d -exec chmod g=rwxs “{}” ; <br>sudo find /var/www -type f -exec chmod g=rws “{}” ;</pre> <br><i>See</i> <a href=“”>HTTPD - Apache2 Web Server</a>.

I have no idea how to do that. I’m googling it, no luck so far.

<b>“Maybe I need to tie the username I’m login in with to /var/www”</b> <br> <br>Yes! You need to do that. You don’t necessarily have to have the user own that directory, however. Simply put the user in the same group.

Yes, I tried that. It stopped logging in altogether. <br> <br>Now I am able to login just fine but it’s taking me to the wrong directory. Maybe I need to tie the username I’m login in with to /var/www

Have you tried employing the solution that @vic.palm2849 described, here: <a href=“”>Set up vsftpd but now I’m getting 550 Permission denied error</a>?

I was just able to login with “snitz” but its taking me to /home/snitz but my files are in /var/www <br> <br>I gave “snitz” root access following this tutorial: <br> <br>visudo

How did you give snitz root access?

Sat Jul 27 19:01:46 2013 [pid 1] [snitz] OK LOGIN: Client “” <br> <br>You were able to log in as snitz. Does your FTP client output an error when you try to login as snitz?