https://www.vultr.com

The Everywhere Cloud

Deploy an instance.
Accelerate your application.


Owner and Perm of Web Items in Debian-based Linux


The following steps provide all directories and files in the www folder with the appropriate ownership and permissions to ensure smooth operation of the web server. This also prevents unauthorized users from viewing and modifying them.

==========

1. Change ownership of all items to user "root" and group "www-data".

user@host: $ sudo chown -R root:www-data /var/www

2. Change permission modes to 750 for directories only. User "root" can (r)ead, (w)rite, and e(x)ecute directories. Users included in the group "www-data" can (r)ead and e(x)ecute but NOT write to directories. All other users are excluded.

user@host: $ sudo find /var/www -type d -exec chmod 750 {} +

3. Change permission modes to 640 for files only. User "root" can (r)ead and (w)rite but NOT execute files. Users included in the group "www-data" can (r)ead but NEITHER write NOR execute files. All other users are excluded.

user@host: $ sudo find /var/www -type f -exec chmod 640 {} +

==========

Comments

Popular posts from this blog

Enabling HTTPS in Home Assistant

Configuring the FreeBSD Firewall with IPFW

Running Home Assistant on FreeBSD Servers