0

When I type ls -l and press enter I get a list of files, with details about each file. Next to each file there is permissions and rights for each file. What do they mean? For example:

-rw-rw-rw-

I am thinking this means read and write access, though for whom and what? Essentially, if I needed to modify a file or change rights, I would need to know what I can and cannot change.

3 Answers3

2

This is the basics of permissions covered.

The confusion often occurs when you have to start actually setting permissions on your file server or local machine. When you use FTP or SSH or on your local terminal (if you are using Linux of course), you'll see lots of funny letters next to the files (such as rwxrw-rw-). I'll explain what all these hieroglyphics mean!

When you FTP to your web server, you'll probably see something like this next to every file and folder:

Attributes list

This string of letters, drwxrwxrwx, represents the permissions that are set for this folder. (Note that these are often called attributes by FTP programs.) Let's explain what each of these letters means:

d   r   w   x   r   w   x   r   w   x
    Owner          Group      Other

Directory   Read    Write   Execute Read    Write   Execute Read    Write   Execute

d=directory r=read w=write x=execute

As you can see, the string of letters breaks down into 3 sections of 3 letters each, representing each of the types of users (the owner, members of the group, and everyone else). There is also a "d" attribute on the left, which tells us if this is a file or a directory (folder).

VaTo
  • 3,101
0

This article "viewing permissions using ls" explains the output of ls -l command. And the permissions of a file can be changed using the chmod command.

Minix
  • 5,855
Pratap
  • 101
0

Basic File Permissions

Permission Groups
Each file and directory has three user based permission groups:

owner - The Owner permissions apply only the owner of the file or directory, they will not impact the actions of other users.
group - The Group permissions apply only to the group that has been assigned to the file or directory, they will not effect the actions of other users.
all users - The All Users permissions apply to all other users on the system, this is the permission group that you want to watch the most.

Permission Types
Each file or directory has three basic permission types:

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.
The permission in the command line is displayed as: _rwxrwxrwx 1 owner:group

Check this link: https://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions

verovan
  • 61