How to check and read your file permissions

Check your permission
For seeing what permissions the file contains, type to the terminal:

    $ ls -l the_file
    $ -rw-r--r-- 1 Iiro GroupName  123234 Nov 3 13:56 the_file

From here we see that owner of ”the_file” is Iiro,
the user has read and write permissions (-rw-r--r--),
”the_file” is owned by group ”GroupName”,
the group has read permission (-rw-r--r--),
Other users can read the file (-rw-r--r--).


How to read the permissions
Permissions characters can be read ”r”, write ”w”, and execute ”x”.
Permissions are listed in sets of three, expect for the first one.

-rwxrw-r--
The first character (marked as red bold) is usually indicating if the file is regular file or directory. It can be either d (directory) or – (regular file), but there is also many more uncommon ones such as socket, symbolic link and other file systemobjects.

-rwxrw-r--
The first set of three (marked as red bold) is indicating owner permissions. The owner of this file has read, write and execute permissions.

-rwxrw-r--
The second set of three (marked as red bold) is indicating member of the owning group permissions. The members of owning this file has read, write permissions.

-rwxrw-r--
The last set of three (marked as red bold) is indicating permissions for all other users. All other users have permission to read the file.

These posts are done in a purpose of being my personal notes for Information Security course exam. Might contain some inaccurate information.

Linux permission have always been kind of struggle to remember for me. I am usually not the guy administering server configurations and every time I need to do that, there is always the all holy Google. Not in the exams there isn’t.

Vastaa

Täytä tietosi alle tai klikkaa kuvaketta kirjautuaksesi sisään:

WordPress.com-logo

Olet kommentoimassa WordPress.com -tilin nimissä. Log Out /  Muuta )

Google photo

Olet kommentoimassa Google -tilin nimissä. Log Out /  Muuta )

Twitter-kuva

Olet kommentoimassa Twitter -tilin nimissä. Log Out /  Muuta )

Facebook-kuva

Olet kommentoimassa Facebook -tilin nimissä. Log Out /  Muuta )

Muodostetaan yhteyttä palveluun %s