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()
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
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=“https://help.ubuntu.com/12.04/serverguide/httpd.html”>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=“https://www.digitalocean.com/community/questions/set-up-vsftpd-but-now-i-m-getting-550-permission-denied-error”>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: https://www.digitalocean.com/community/articles/initial-server-setup-with-ubuntu-12-04 <br> <br>visudo
How did you give snitz root access?