85 reputation
119
bio website twitter.com/charlesroper
location United Kingdom
age 39
visits member for 2 years, 2 months
seen 8 hours ago
Just a biodiversity tech-dude working for a Local Biodiversity Record Centre, near Brighton, UK.

Oct
9
comment SFTP permission denied on files owned by www-data
Thanks Marty. This part from the Apache Cookbook made me laugh: "You should be aware that if you ask 12 people for the correct ways to set file permissions on your Apache server, you will get a dozen different answers." You've given me most everything I need to make progress now. Thank you so much for your time. :-)
Oct
8
comment SFTP permission denied on files owned by www-data
Update: I asked on the httpd IRC channel and someone provided the canonical advice. So in my case I need to also add Apache to webmasters so that it may read files and chown the files to myself so that I may edit them. If I need to give additional users write permissions, I'll need to use ACLs.
Oct
8
comment SFTP permission denied on files owned by www-data
Actually, another clarification needed: if I make files in /var/www owned by webmasters, how will Apache read those files? Presumably I don't want to add Apache to webmasters because then I'm back in the same situation of Apache having overly permissive permissions.
Oct
8
comment SFTP permission denied on files owned by www-data
Just one clarification needed if that's okay? The files and directories that need to be writable by Apache, should they be owned by www-data and not webmasters?
Oct
7
comment SFTP permission denied on files owned by www-data
Update: I'm also going to work with the other devs to ensure only those files and directories that require write permission have write permission, otherwise all files within /var/www will be set to read-only for the www-data group.
Oct
7
comment SFTP permission denied on files owned by www-data
And I do need to give other users access to /var/www so I thought giving group access to www-data and making everyone a member of that group would be a good solution. I can see now the problem of Apache being able to overwrite any file in there, though. Given only 2 devs (which includes myself) have access to the code, it's relatively safe in the short term.
Oct
7
comment SFTP permission denied on files owned by www-data
Hi @marty-fried, thanks for the answer, it gives me plenty to try out. Re. your questions. I pieced the info together from various sources (hence why I wrote it down into my own-use guide) and can't remember the exact source. Although I didn't use this particular source (solution 1) (I only just found it), it gives a good rationale for my decision. In the Apache guide you mention, it recommends creating a group called 'webmasters', but if I did that, how would Apache write to the /var/www without also adding it to that group?
Oct
4
comment SFTP permission denied on files owned by www-data
Hi, thanks for taking the time to answer, it's much appreciated. However, it doesn't really help. Chowning the files makes ALL of them unmodifiable when using SFTP (so kind of the opposite of what I'm after!). I can't really use the chmod workaround because a) I don't have permissions to chmod in SFTP; b) I don't really want to log in via SSH, change permissions, do my SFTPing, change back, etc.; and c) some files have different permissions for security reasons, so I can't chmod en masse anyway.
May
23
comment How do I install Guest Additions in a VirtualBox VM?
I came across this answer while trying to install Guest Additions on Ubuntu Server. One step is missing if you need to install on server: run sudo apt-get install dkms first. (ref virtualbox.org/manual/ch04.html#idp19765808)