By nicholasfc
I have a droplet running ubuntu 14.04 and a LEMP stack. I have subdomains on the /var/www folder with each having its own folder inside /www. I have one user with root permissions that is the one that I use for ssh and sftp. When I trie to write the file via sftp I have permission denied.
All the folders have 755 and the file have 644.
What do I need to change to get it working?
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!
The above method DIDNT work for me on Ubuntu 18. It started giving me permission denied error instead.
This question was answered by @sierracircle:
you could try this:
make sure your user is a member of the www-data group:
sudo usermod -a -G www-data $USERthen give group permissions:
sudo chmod -R 775 /var/www
You can see the comment here.
I use MobaXterm and I was getting this error when trying to upload a file from my Windows XP file system to a CentOS 7.2 droplet. Error: “SFTP error #1: Permission denied”. I run Apache 2. After finding this document I tried the “sudo usermod -a -G www-data $USER” command and I got the response:
usermod: group 'www-data' does not exist
So I tried using this command:
$ sudo usermod -a -G www $USER
…and it worked. Also I checked the sudo file using: visudo but I didn’t see the user listed in the www group. But it seemed to work.
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.