Operations 6 min read

Unlock Linux File Permissions: A Complete Guide to Managing Access Rights

This article explains Linux file permission concepts, numeric and symbolic representations, how to combine and modify permissions with chmod (including recursive changes), ownership categories, testing permission effects on files and directories, and default permission settings derived from umask.

Raymond Ops
Raymond Ops
Raymond Ops
Unlock Linux File Permissions: A Complete Guide to Managing Access Rights

Linux Permission Management

Permissions define what actions a user can perform on a file; the root user has all permissions.

1. Permission Classification

Permissions are divided into three parts, each with a numeric code:
    Read (r)    : 4
    Write (w)   : 2
    Execute (x) : 1
    No permission (-) : 0

Executing a script == running a script

2. Detailed Permission Information

Permission bits are split into three sections: owner, group, others.
Example: drwxr-xr-x
    d   : file type
    rwx : owner
    r-x : group
    r-x : others
Permission bits illustration
Permission bits illustration

3. Adding Permissions by Summation

Using drwxr-xr-x as an example:
    Owner : read, write, execute
    Group : read, execute
    Others: read, execute

rwxr-xr-x is equivalent to 755

4. Modifying Permissions

Command: chmod
Format: chmod [options] permission_expression target

Options:
    -R : apply changes recursively to directories and their contents

Example: chmod -R 755 /root/text/   # sets all files to rwxr-xr-x
chmod recursive example
chmod recursive example

5. Ownership Categories

Owner : u

Group : g

Others: o

Purpose: change permissions for a specific class.
Example: chmod g-r,g+w 1.txt   # remove read from group, add write
chmod class example
chmod class example

6. Why Testing Permissions Matters for Users

Regular users must strictly follow permission rules.

Root user overrides permission restrictions.

Changes take effect after re‑login (su or su -).

7. Significance of Permissions on Directories

To read a file, the path must have execute (x) permission on each directory and read (r) on the file.

To write a file, the path needs execute on directories and write (w) on the file.

To execute a file, directories need read and execute, and the file itself needs execute.

directory permission illustration
directory permission illustration

8. Default Permissions for New Files

Check default file permissions with: /etc/profile

default permission source
default permission source
Common defaults:
    Files : 666 (modified by umask)
    Directories : 777 (modified by umask)

Default file permission = 644 (666 - 022)
Default directory permission = 755 (777 - 022)

Useful commands:
    /usr/bin/id -un   # username
    /usr/bin/id -gn   # group name
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

OperationsLinuxUnixfile systemPermissionschmod
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.