Logotipo horizontal de Diego C Martín colores invertidos, blanco y naranja para findo negro

Use of permissions in Linux and its application in WordPress

Categorías:  Autor: Diego C Martin 
img-2

Permissions in Linux are used to control access to files and directories in the file system.

Each file and directory on the system has three types of permissions: read (r), write (w), and execute (x).

Permissions can be set for three types of users: the owner of the file, the group to which the file belongs, and other users.

The owner of a file is the user who created the file or directory, and the group to which the file belongs is a group of users that are used to facilitate permission management in a multiuser system.

Permissions are set using an octal number system, where each permission is represented by a number:

  • Read permission is represented by the number 4. In binary 100.
  • The write permission is represented by the number 2. In binary 010.
  • The execution permission is represented by the number 1. In binary 001.

Permissions in linux are set for each of the three types of users and are represented by a three-digit number. The first digit represents permissions for the owner, the second digit represents permissions for the group, and the third digit represents permissions for other users.

The “rw-r–r–” permission indicates that the owner has read and write permission, the group has read permission only, and other users also have read permission only.

In binary it would be 110 for the owner, which in decimal is a 6.

100 for the group and for the rest, in decimal a 4.

Using the chmod command on Linux

We can set permissions on Linux using the chmod command followed by a three-digit string representing permissions for the owner, group, and other users.

The “chmod 644 file.txt” command would set read and write permissions for the owner and read permissions only for the group and other users on the “file.txt” file.

Necessary permissions on WordPress folders and files

The proper permissions for WordPress folders depend on the specific configuration of the server and the environment in which the website is hosted. In general, it is recommended to set permissions securely to ensure that your site is secure and functioning properly.

General tips on WordPress folder permissions:

  • WordPress parent folders, such as wp-content, wp-includes, and wp-admin, must have read and write permissions for the file owner and read-only permissions for the group and other users.
  • WordPress files must have read and write permissions for the file owner and read-only permissions for the group and other users.
  • The wp-content/uploads folder, where media files uploaded to WordPress are saved, must have write permissions for the file owner and read-only permissions for the group and other users.

It’s important to note that some WordPress plugins and themes may require additional permissions to work properly. Therefore, it may be necessary to adjust the permissions of some specific folders and files as needed to allow certain plugins or themes to work properly.

Put permissions to WordPress from the Linux terminal

To set secure permissions for the wp-content folder:

img-3

Where “/path/to/wp-content” is the absolute path to the wp-content folder on the server.

This command sets write permissions for the file owner and read-only permissions for the group and other users.

We would do the same for the download folder in wp-content/uploads.

To set secure permissions for WordPress files:

img-4

This instruction uses the “find” command to find all files in the WordPress folder and sets read and write permissions for the file owner and read-only permissions for the group and other users.

Leave a Reply

Your email address will not be published. Required fields are marked *

Artículos de la misma categoría

crossmenu
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram