Quantcast
Viewing latest article 6
Browse Latest Browse All 10

Folder Permission

What are file permissions

Every file or folder in Linux has access permissions. There are three types of permissions (what allowed to do with a file):

    read access
    write access
    execute access

Permissions are defined for three types of users:

    the owner of the file
    the group that the owner belongs to
    other users

Thus, Linux file permissions are nine bits of information (3 types x 3 type of users), each of them may have just one of two values: allowed or denied.

Simply put, for each file it can be specified who can read or write from/to the file. For programs or scripts it also can be set if they are allowed to be executed.

File permissions notation

It is used in Linux long directory listings. It consists of 10 characters. The first character shows the file type. Next 9 characters are permissions, consisting of three groups: owner, group, others. Each group consists of three symbols: rwx (in this order), if some permission is denied, then a dash “-” is used instead.

Example:

-rwxr–r–
0123456789

    Symbol in the position 0 (“-”)is the type of the file. It is either “d” if the item is a directory, or “l” if it is a link, or “-” if the item is a regular file.
    Symbols in positions 1 to 3 (“rwx”) are permissions for the owner of the file.
    Symbols in positions 4 to 6 (“r–”) are permissions for the group.
    Symbols in positions 7 to 9 (“r–”) are permissions for others.

r Read access is allowed
w Write access is allowed
x Execute access is allowed
- Replaces “r”, “w” or “x” if according access type is denied

Other example:

use chown to assign the corresponding user to the share folder
e.g. chown USERNAME PATH
e.g. chown -R USERNAME PATH

allow write permission for owner
e.g. chmod 700 PATH

700 owner has full permission
755 owner has full permission + other people can read but not write

Source : http://www.zzee.com/solutions/linux-permissions.shtml


Viewing latest article 6
Browse Latest Browse All 10

Trending Articles