Linux File Permissions Explained
Understand rwx, octal modes, ownership and the special permission bits — and fix permission problems for good.
Permission errors are among the most confusing moments for new Linux users: Permission denied. This tutorial removes the mystery. You will learn exactly what those ten characters at the start of ls -l mean, how to read and set permissions with chmod, and how ownership with chown and chgrp fits in.
Run these commands on a test directory
Some examples change system files. Work in a scratch directory in your home folder while following along.
By the end of this tutorial you will be able to:
- Read
ls -lpermission strings fluently - Set permissions with symbolic and octal modes
- Change owners and groups with
chownandchgrp - Explain setuid, setgid and the sticky bit
Advertisement
Tutorial Lessons
- 01 Reading Permission Bits Decode the ten characters produced by ls -l: file type, rwx triads and more. 2 min
- 02 Changing Permissions with chmod Set permissions symbolically and with octal numbers. 2 min
- 03 Ownership with chown and chgrp Change the owner and group of files, and understand when you need sudo. 2 min
- 04 Special Permissions: setuid, setgid and the Sticky Bit The fourth permission slot — setuid, setgid and the sticky bit on directories. 2 min
Advertisement