Permission denied on SFTP

Hi there,

I am now trying to upload files to an account I have on my new server at Linode (I am using VirtualHosts).

Everything looks fine, except I can't upload files to my public_htmlfolder, at /var/www/html/website.com.com/public_html.

SFTP client does not uploads anything, and generates a lot of open for write: permission denied - Error - Transfer failederrors.

I have already added the public_htmlfolder to the group www-data, as well as added my own user to that group (I am logged at SFTP using this same user).

But, unfortunately, the issue still happening.

Someone could help me here, please?

3 Replies

Well, it seems the issue was resolved, at least for now.

I tried to run:

sudo usermod -a -G www-data my_user
sudo chown -R www-data /var/www/html/website.com.com/public_html
sudo chgrp -R www-data /var/www/html/website.com.com/public_html
sudo chmod -R 755 /var/www/html/website.com.com/public_html

With the above I had, I think, added my user to the group www-data, changed the ownership of the directory to www-data, changed the directory to the group www-data and set the chmod permissions to 755.

But none of this solved the problem.

What has solved, at least I think and for now, was:

sudo chmod -R g+w /var/www/html/website.com.com/public_html

Well, I am now uploading the files through SFTP (Filezilla).

But, my new question is, please: the above procedures could cause any harm or problem to the server?

Thanks once again.

I run as:

| dir           | owner         | perm  |
| ------------- |-------------  | ----- |
| www           | root          | 775   |
| html          | root          | 755   |
| some domain   | root          | 775   |
| public-html   | me (user)     | 775   |
| index.html    | me (user)     | 775   |

There is one system I run called EspoCRM which runs in a sub-directory of a parent domain and it is owned by www-data… as mandated by the system developer.

Maybe this will help?

Hi @acanton77 ,

Thank you very much.

So you have public_html and all its subfolders running with your own user? What's the purpose of www-data, do you know?

I thought it must be used for public_html and similar stuff.

Do you know if there's some problem on what I've done, i.e., to run public_html with www-data ownership?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct