Owner and Group (FTP permissions error)

Hi, I'm new to setting permissions for a web server.

To the online user browsing our website, everything appears to be perfect. I've disabled root login and I'm using my one sudo user to log in via FTP, using WinSCP. I'm running a straight html site at the root web folder (/home/user/public/website.com/public/) and I have a WP blog running in a subfolder there. My problem is that I must have the ownership messed up for the folders because I can't write files via FTP. Is it possible that I've flipped the ownership/user? I would appreciate any advice that you may have as to how I can properly set up chmod and chown for this site. If you see anything here that looks to open to security issue also, please let me know. Thanks!

Working down the folders from /home/user/, I have this right now ('user' is standing in for my actual sudo username):

> drwxr-xr-x 4 user user 4096 2012-06-12 12:16 public

drwxrwxr-x 5 user user 4096 2012-05-31 11:16 website.org

drwxr-xr-x 34 user user 12288 2012-06-15 09:42 public <–-this is the actual site with index.html

-rw-r--r-- 1 www-data user 28187 2012-06-14 10:05 index.html <---every file in website

drwxr-xr-x 19 www-data user 4096 2012-01-03 17:17 wordpressblog <---every folder in website

2 Replies

If I have things backward (which I suspect I do), what is the chown syntax that will fix this? I'd like to maintain the proper www-data ownership and group on the folders and files that require www-data:www-data for wordpress to function (wp-content and uploads).

Thanks!

OK. I think I fixed it all. I switched user and www-data recursively on everything below public and then went in and made the www-data:www-data modification to just the wp-content folder and recursively on the uploads folder there. This is resolved I think. In fact I wish I could delete this thread because it turns out that I already knew the answer. Being new to this, I am just being cautious as I make these type of changes.

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