Linux File PermissionsUsing ChmodOverviewThis how to is for introducing members file permissions on Linux.
What are PermissionsPermissions specify who can read, write or execute a file. These permission can be found in the far left column of a long listing (the -l switch). The first character specifies the file type ('-' for a file, 'd' for a directory, etc), and the next nine characters specify who has permission to do what with a file.Permissions are broken down into three groups, each with three permissions. The three groups are owner, group, and other (everyone else). The owner is the person who created the file. Group is the group the owner belongs to and other is, well everone else! Each group has three different modes of permission: read, write, and execute. The permissions can be used in any combination: -rwxrwxrwxwould give everyone full access to the file, whereas -rwxr-xr--would give the owner full access, the group the owner belongs to read and execute access, and everyone else read access.
Changing PermissionsPermissions are changed with the command chmod (change mode). The format of the command is:chmod xyz [file]where x,y, and z represent numbers. The numbers you specify allow you to set the read, write and acess permissions for any group, where x is for owner, y is for group, and z is for everyone else. Octal encoding is used to determine each specific number, and is calculated as follows:
chmod +x myfile.htmlwill make the file myfile.html executable for all users. You can further narrow down which groups receive permissions, these can be found by typing man chmod. |