Learn the Terminal

Ownership & Permissions

Understand chown, chmod and safe Linux access controls before application folders are created.

Guide difficulty⭐⭐⭐⭐⭐ Beginner Friendly
Estimated time⏱️ Around 25–35 minutes

By the end of this lesson you will understand

  • The difference between ownership and permissions.
  • What chown and chmod do.
  • What 755, 775, 644 and 777 mean.
  • Why 777 is usually the wrong permanent fix.

Ownership

Every file and folder has an owner and group. Incorrect ownership can prevent an application from reading or writing its data.

ls -l
sudo chown serveradmin:serveradmin file.txt
sudo chown -R serveradmin:serveradmin /storage/media

The name before the colon is the owner. The name after it is the group. -R includes everything inside the folder.

Permissions

Permissions control who can read, write or execute an item.

4Read
2Write
1Execute

How the numbers work

The values are added: 7 means read + write + execute, 6 means read + write, and 5 means read + execute. The three digits apply to owner, group and everyone else.

Common modes

ModeMeaning
755Owner can change it; others can read and enter it.
775Owner and group can change it; others can read and enter it.
644Owner can change it; others can read it.
777Everyone has full access.

What sudo means

sudo runs one command with administrator privileges. Read the full command and confirm every path first.

Safety rules

  • Use the narrowest practical permissions.
  • Check paths before recursive changes.
  • Do not make 777 a permanent shortcut.
  • Record important ownership or permission changes.

Download the complete reference

Linux Command Cheat Sheet

Keep a local copy with your private server documentation.

⬇️ Download TXT Cheat Sheet