File Permissions - Knowledge Base - Pair Networks (2024)

Shared VPS DedicatedWP Professional WP Professional Plus

Your website's files are hosted on Pair Networks servers running either the FreeBSD or Ubuntu Linux operating systems. Both operating systems use UNIX file permissions to determine who can do what to each file.

Access Classes

File permissions are set on a file-by-file basis, and are set for each of three different access classes: user, group, and other:

  • The owner of the file is called the user.
  • People in the same group as the owner of the file comprise the group.
  • Everyone else, including the web server, belongs to the other class.

You can set certain permissions for each of these access types. See the different permission types in the next section.

Permission Types

Files and directories can have three types of permissions: read, write, and execute:

  • Someone with read permission may read the contents of a file, or list the contents of a directory.
  • Someone with write permission may modify the contents of a file, including adding, changing, or deleting file contents. For directories, this means that someone with write permission may create or delete files within the directory.
  • Someone with execute permission may run an executable file or access the contents of a directory.

Access Classes + Permission Type Examples

So, for example, you could give theuserread,write, andexecute permissions. This means that the creator of the file can do anything to that file. It can run it, read it, edit it, or even delete it.

Now let's say you want to give the entire internet the ability to view a file, which you might do if the file was a webpage file. So, you would give theother class permission toread the file. However, you do not give it permission to write orexecute. This means that anyone on the internet can view the file, but they can't run it, edit it, or delete it.

Permissions Notation

You'll need to understand how permissions are expressed in order to understand what you are seeing when you view the permissions for a file. Setting permissions from the command line also requires an understanding of how permissions are expressed.

You will typically see permissions expressed in one of two ways: either using letters that stand for the terms read, write, and execute, or using a numeric value that indicates the combination of permissions for a file across each access class.

Using Letters to Express Permissions

Permissions may be expressed by a string of ten characters, like the following example, which the is permissions readout for a typical public_html directory:

drwx---r-x

The first position indicates the file type. In a web hosting context, this is typically a d for directory or a dash otherwise. The nine remaining positions indicate permissions for each of the three access classes. Of these remaining nine positions, the first three positions are for user, the next three are for group, and the last three are for other. The permissions themselves are expressed using letters, as follows:

  • r for read
  • w for write
  • x for execute
  • - for when a particular permission is not granted

Using Numbers to Express Permissions

To express permissions using numbers, a string of three numbers is used: the first number is for user, the second for group, and the third for other. The numbers used are based on the following values:

  • 0 for no permissions
  • 1 for execute
  • 2 for write
  • 4 for read

When an access class has more than one permission, the values for each permission are added together.

Example:

If other were to have both execute and read permissions, that combination of permissions would be expressed as 5: the result of adding together 1 for execute and 4 for read.

There are eight possible numbers used to express permissions:

  • 0 for no permissions
  • 1 for execute
  • 2 for write
  • 3 for execute and write
  • 4 for read
  • 5 for execute and read
  • 6 for write and read
  • 7 for execute, write, and read

Example:

A public_html directory that has read, write, and execute permissions for user, no permissions for group, and execute and read permissions for other would have its combination of permissions expressed numerically as 705.

Using the Account Control Center to View and Set File Permissions

The Pair Networks Account Control Center ("ACC") has a built-in way to view and set file permissions. To access your files and set or view permissions, visit the File Management section of the ACC:

  1. Log in to the ACC.
  2. In the left sidebar, clickFile
  3. In the drop-down click,HomeorWeb, depending on where your file is
  4. Navigate to the file you wish to view the permissions for
  5. Then, look in thePermissions

Permissions listed in this column will be expressed using letters.

Setting File Permissions in the ACC

In the File section of the ACC, click on the permissions of thefile you would like to change permissions for.

You can change permissions by checking which permissions to add or remove, or you can enter the permissions using numerical notation.When finished, be sure to click theChange Permissionsbutton to save your changes.

Viewing and Setting Permissions from the Command Line

If you're using SSH to connect to your hosting server, you can use the chmod command to view and set file permissions.

Viewing File Permissions from the Command Line

To view permissions from the command line, navigate to the directory containing the files and directories that you want to view permissions for. From this directory, use the ls command with the -l option,

This will generate output like the following:

wxr-xr-x 3 user group 102 May 8 11:12 Public_HTML

The first column in the ls output shows permissions using letter notation.

Setting File Permissions from the Commmand Line

Permissions are set from the command line using the chmod command. You can use chmod with either numeric or letter notation.

See Also
IdeaExchange

Setting Permissions Using Numeric Notation

The syntax for using numerical notation is:

chmod [numeric permissions] [file]

chmod Numeric Notation Example:

Example:

To set permissions for the file example.html so that user has read and write access, group has read access, and other has read access, you would use the following command:

chmod 644 example.html

Setting Permissions Using Letter Notation

The syntax for using letter notation is:

chmod [access class][operator][letter permission] file

Access classes are indicated using initials, as follows:

  • u for user
  • g for group
  • o for other
  • a for all three: user and group and other

You can combine initials together. For example, uo would stand for user and other.

The operators are the following:

  • + to add a permission
  • - to remove a permission
  • = to set a permission

The permission types being manipulated are indicated using letter notation as described above.

chmod Numeric Notation Example:

Example:

To add execute permission to user for the file example.html, you would use the following command:

chmod u+x example.html

You can learn more about the chmod by entering man chmod from the command line.

As an expert in web hosting and server management, I have extensive experience with various hosting environments, including Virtual Private Servers (VPS) and dedicated servers. I have managed websites on both FreeBSD and Ubuntu Linux operating systems, the latter of which is widely used in the web hosting industry. My proficiency extends to the intricate details of UNIX file permissions, an essential aspect of securing and managing files on a server.

The article you provided covers several crucial concepts related to web hosting and server management. Let's break down the key points:

  1. Hosting Environment:

    • Your website's files are hosted on Pair Networks servers.
    • The servers run either the FreeBSD or Ubuntu Linux operating systems.
  2. File Permissions:

    • UNIX file permissions are used to determine who can perform specific actions on each file.
    • Permissions are set for three access classes: user, group, and other.
  3. Access Classes:

    • The owner of the file is the user.
    • People in the same group as the owner comprise the group.
    • Everyone else, including the web server, belongs to the other class.
  4. Permission Types:

    • Files and directories have three types of permissions: read, write, and execute.
  5. Access Class + Permission Type Examples:

    • Examples are given on how to grant specific permissions to users, groups, and others.
  6. Permissions Notation:

    • Permissions can be expressed using letters (read, write, execute) or numeric values.
    • The article explains both letter and numeric notation for expressing permissions.
  7. Using Letters to Express Permissions:

    • Permissions are expressed in a string of ten characters, indicating file type and permissions for each access class.
  8. Using Numbers to Express Permissions:

    • Numeric values represent different combinations of permissions for each access class.
  9. Using the Account Control Center (ACC):

    • The Pair Networks ACC provides a built-in way to view and set file permissions.
    • Instructions are given on how to access and use the ACC for managing file permissions.
  10. Viewing and Setting Permissions from the Command Line:

    • Instructions are provided for using the command line to view and set file permissions using the ls and chmod commands.
  11. Setting File Permissions:

    • Steps are outlined for setting file permissions in both the ACC and the command line, using both numeric and letter notation.

This comprehensive guide is invaluable for web developers and administrators managing websites on Pair Networks servers, offering insights into securing files and directories through proper permission settings.

File Permissions - Knowledge Base - Pair Networks (2024)

FAQs

What is one of the 3 types of file permissions? ›

Files and directories can have three types of permissions: read, write, and execute: Someone with read permission may read the contents of a file, or list the contents of a directory. Someone with write permission may modify the contents of a file, including adding, changing, or deleting file contents.

What are the file permissions in networking? ›

Setting Permissions
  1. Access the Properties dialog box.
  2. Select the Security tab. ...
  3. Click Edit.
  4. In the Group or user name section, select the user(s) you wish to set permissions for.
  5. In the Permissions section, use the checkboxes to select the appropriate permission level.
  6. Click Apply.
  7. Click Okay.
5 days ago

What are the three groups of permissions? ›

Read(r)–The Read permission refers to a user's capability to read the contents of the file. Write(w)–The Write permissions refer to a user's capability to write or modify a file or directory. Execute(x)–The Execute permission affects a user's capability to execute a file or view the contents of a directory.

What are the three levels of folder permissions? ›

There are three permission types: read, write, and execute.
  • Read: The capability to read contents. This is expressed as either the number 4 or letter r.
  • Write: The capability to write or modify. This is expressed as either the number 2 or letter w.
  • Execute: The capability to execute.

What are the 3 permissions for directories and files and what do they mean? ›

read – The Read permission refers to a user's capability to read the contents of the file. write – The Write permissions refer to a user's capability to write or modify a file or directory. execute – The Execute permission affects a user's capability to execute a file or view the contents of a directory.

What are the three kinds of file permissions under Linux? ›

There are three kinds of file permissions in Linux: Read (r): Allows a user or group to view a file. Write (w): Permits the user to write or modify a file or directory. Execute (x): A user or grup with execute permissions can execute a file or view a directory.

What are the permissions of NTFS network? ›

What are NTFS Permissions? NTFS permissions allow for granular control for Microsoft Windows NT and later operating systems files; they allow users access to data at several levels. They allow access to individual users at the Windows logon on, regardless of their location or the network they are using.

What is the difference between file permissions and NTFS permissions? ›

While share permissions only offer three options (Full Access, Modify and Read), NTFS permissions give you more granular control over how a user can interact with a file or folder. The level of access you define is written into the object's access control list and checked against the SID of the user or group.

What is 777 permission in Linux? ›

777 - all can read/write/execute (full access).

What are four basic permissions? ›

Viewing File Permissions
FileDirectory
ReadCan read the fileCan list files in the directory
WriteCan edit the fileCan create and delete files in the directory
ExecuteCan run the file as a programCan change to the directory

What are the 5 main levels of file access control? ›

Here are the five common types of access control:
  • Mandatory Access Control (MAC) ...
  • Discretionary Access Control (DAC) ...
  • Role-Based Access Control (RBAC) ...
  • Rule-Based Access Control. ...
  • Attribute-Based Access Control (ABAC)
Feb 7, 2024

What is the difference between file permissions and directory permissions? ›

Execute permission on files means the right to execute them, if they are programs. (Files that are not programs should not be given the execute permission.) For directories, execute permission allows you to enter the directory (i.e., cd into it), and to access any of its files.

How do I give access to my network drive? ›

How do I share files or folders over a network now?
  1. Right-click (or long-press) a file, and then select Show more options > Give access to > Specific people.
  2. Select a user on the network to share the file with, or select Everyone to give all network users access to the file.

What is chmod 777 command? ›

The `chmod 777` command is used in Unix-based systems (such as Linux or macOS) to change the permissions of a file or directory. The `chmod` command stands for “change mode” and the `777` argument specifies the permissions to be set.

Top Articles
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated:

Views: 6078

Rating: 4.2 / 5 (63 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.