How To Set Readonly File Permissions On Linux / Unix Web Server DocumentRoot

How To Set Readonly File Permissions On Linux / Unix Web Server DocumentRoot

To set read-only file permissions on the document root of a Linux or Unix web server, you can use the chmod command with the 644 permissions.

The chmod command allows you to change the permissions of a file or directory. The 644 permissions allow the owner of the file to read and write to the file, and allow others to read the file but not write to it.

For example, to set the document root directory /var/www/html to have read-only permissions for all users, you can use the following command:

chmod 644 /var/www/html
‮uoS‬rce:www.lautturi.com

This will set the permissions of the /var/www/html directory to 644, which will allow the owner of the directory to read and write to it, and allow others to read it but not write to it.

It's important to note that you may need to have root privileges to use the chmod command to change the permissions of a file or directory.

For more information about using the chmod command, you can refer to the chmod manual page or use the --help option. For example:

man chmod
chmod --help

It's also important to note that you may need to restart your web server for the changes to take effect.

Created Time:2017-10-29 22:08:31  Author:lautturi