A quick guide to Linux Permissions 🚫

A quick guide to Linux Permissions 🚫

After typing ls -l, you’ll get a list of all files & directories, along with other information, including permissions associated with those files & directories. These permissions might look like this:

-rw-rw-r--
lrwxrwxrwx
-rwxr-xr-x

These permissions can be divided up as follows:

  • position 1 = type of object
  • positions 2-4 = permissions for owner
  • positions 5-7 = permissions for group
  • positions 8-10 = permissions for world

Possible types for position 1:

  • = directory
  • -= file
  • = link to another file or object (like a Windows shortcut)
  • = socket
  • = pipe
  • = block device (eg, a disk drive that handles data a block at a time)
  • = character device (eg, serial or parallet ports that handle data on byte, or character, at a time)

Positions 2, 3, & 4 tell us if the owner has read, write, & execute permissions for the file or object.

read
write (create, modify, delete)
execute (run)

– in any position indicates that the user does NOT have permission to read, or write, or execute.

Positions 2-4 correspond to positions 5-7 and 8-10 for the group and the world, respectively. In other words, permissions can be read as follows:

<object type><owner read><owner write><owner execute><group read><group write><group execute><world read><world write><world execute>

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.