Developer Reference

Linux Permissions

Visual guide to chmod numbers (777, 644) and permission symbols.

Understanding Linux file permissions is crucial for server security. This reference defines read (r), write (w), and execute (x) permissions and their octal equivalents.

Numeric

Read, write, and execute for everyone (Dangerous)
rwxrwxrwx
Owner has all; others can read and execute (Common for scripts)
rwxr-xr-x
Owner can read/write; others can only read (Common for files)
rw-r--r--
Owner can read/write; no access for others (Private keys)
rw-------

Command

Make file executable
Executable
Change file owner and group
Ownership

Basics

Read permission
Write permission
Execute permission

Advanced

Set default permissions (755/644)
Default

Sudo

Login as root user
Root

Tricks

Run last command with sudo
Re-run

Attributes

Make file immutable (cannot be changed/deleted)
Immutable
List file attributes
List Attr

ACL

Get Access Control Lists
ACL
Set specific user permissions
ACL

Never guess 'chmod 777' again. Use this guide to set secure permissions for files, directories, and scripts.