How to repair permissions on Linux Apache /var/www/html folder

I recently ran into an issue where I could no longer FTP files to my Linux droplet when multiple users were uploading to the server. The server kept the user as the owner despite me adding them to the www-data group. This fix comes from my ex-boss, James Tomasino who was kind enough to provide some help since I was stumped. I’m sharing in case anyone else runs into the same issue and finds it useful.

You’ll need to fire up terminal, ssh to the server, and then execute these commands:

+s makes permissions sticky so that all files will inherit from the parent directory. This was the setting I was missing.

Open up /etc/ssh/sshd_config. I use nano so:

Hit CTRL+W and look for “subsystem” which is typically located near the bottom of the file. Change

to

If you already have files in the HTML folder, you’ll want to run these commands to reset the permissions:

 


There are no comments.

Leave a Reply