By mattandrews
Hi,
I’ve followed the steps to setup vsftpd on my Ubuntu 12.04 VPS and I can connect to the server with my specially-created FTP user. My issue is that I want that user to have access to /var/www/ (where I keep all my nginx sites). I can browse to that directory but can’t modify anything there – I see things like “550 Delete operation failed” when I try.
I think I could fix this by chown’ing the www directory for my FTP user, but is this a bad idea? I don’t know what permissions nginx expects on that folder – would this break things? Is there a better solution? I just want to be able to upload large files (MP3s etc) via FTP which can then be served on the web.
thanks! matt
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
nginx needs read access only, so you can safely chown the directory to your FTP user. However, that won’t be as secure because your password is sent as plaintext over the internet when you use FTP – consider using SFTP instead :).
sudo chown -R youruser:youruser /var/www
If you’re running a web application that needs write access to a specific directory, you will need to change the said directory’s group ownership to www-data and set group write permissions:
sudo chgrp -R www-data /var/www/directory
sudo chmod -R g+w /var/www/directory
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.