Skip to main content

Linux VPS File Permissions 

This guide explains Linux file permissions in a beginner-friendly way with examples.

Why file permissions matter on a VPS

Every file and folder on a Linux server has rules attached to it.

These rules decide:

  • Who can view files

  • Who can edit files

  • Who can run programs

  • Who can access directories

Without permissions, any user or process could modify system files, steal sensitive data, or break applications. Permissions are one of Linux's biggest security features.

On a VPS, they protect things like:

  • Website files

  • SSH keys

  • Databases

  • application configs

  • Backup scripts

  • System services

A single bad permission setting can expose your entire server.

Understanding the three permission types

Linux permissions are built around three actions:

  • Read (r) - view a file or list a directory

  • Write (w) - modify a file or directory

  • Execute (x) - run a file or access a directory

These permissions work differently depending on whether you’re dealing with files or folders.

For files:

  • r - lets you read the file

  • w - lets you edit the file

  • x - lets you run it as a program or script

For directories:

  • r - lets you list files inside

  • w - lets you create or delete files

  • x - lets you enter the directory

Without execute permission on a directory, you cannot access it — even if you can read it.

The Three Permission Groups

Linux applies permissions to three categories of users:

  • User (u) - the owner of the file

  • Group (g) - users assigned to the same group

  • Others (o) - everyone else

This creates a flexible permission system in which different users can have varying levels of access.

How to View Permissions

The most common command is:

ls -l

Imagine we receive a result as follows:

rwxr-xr-- 

This string is actually an expression of three different sets of permissions:

  • rwx is for Owner permissions

  • r-x is for Group permissions

  • r-- is for Others permissions

Let’s add them together to get a permission set based on the following rules:

  • r (read): 4

  • w (write): 2

  • x (execute): 1

If we take our example, we will get the following permissions:

Owner: rwx = 4+2+1 = 7

Group: r-1 = 4+0+1 = 5

Others: r-- = 4+0+0 = 4

Together, we are getting a permission set - 754.

Did this answer your question?