Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cyber Security Cards › Revision Cards

Permissions: r, w, x, chmod and chown

Permissions: r, w, x, chmod and chown Each file has an owner (u), a group (g) and others (o). Each can have read (r) , write (w) and execute (x) permission. chmod changes permissions. chown changes the owner. Example: chmod 640 file = owner read/write, group read, others nothing. A SUID-root program

Permissions: r, w, x, chmod and chown Each file has an owner (u), a group (g) and others (o). Each can have read (r) , write (w) and execute (x) permission. chmod changes permissions. chown changes the owner. Example: chmod 640 file = owner read/write, group read, others nothing. A SUID-root program
Permissions: r, w, x, chmod and chown · Download PNG
Read card text

What this card says

What it is

Each file has an owner (u), a group (g) and others (o).

Each can have read (r), write (w) and execute (x) permission.

Commands

chmod changes permissions. chown changes the owner.

Example: chmod 640 file = owner read/write, group read, others nothing.

Why it matters for security

A SUID-root program that can open a shell gives an attacker root.

777 web folders and readable private keys are classic holes.

Common mistake

Running chmod -R 777 to fix an error. Never. It hides the real problem and opens a hole.

PermissionOn a fileOn a directory
r (read)View contentsList files (ls)
w (write)Modify contentsCreate/delete files inside
x (execute)Run as program/scriptEnter the directory (cd)

Learn more in the lesson: 5.5 Permissions: r, w, x, chmod and chown

See all Ravi Sir's Cyber Security Cards