Felix discusses how file permissions work with Linux. He covers what they mean, what they’re for, and how to set them.
Felix discusses how file permissions work with Linux. He covers what they mean, what they’re for, and how to set them.
File permissions are the most basic form of security control on a Linux based operating system. They are implemented in a manner which can be configured to grant or deny access to files. The permissions can be modified by either the one who owns the file, or the super user. The instruction to modify the permissions can take numeric arguments or symbolic arguments.
Felix uses a command line example to show you how to see the permissions of a file: Typing “ls” shows you the root directory structure.
He wants to go the test directory so he types the command cd test. Typing ls again shows that this directory has two directories that were previously mounted.
Next he creates a files using command line using the touch command followed by the file he is creating and uses the ls command to verify the file was created.
To find the file permissions of this newly created file he types in ls -l.
For testfile.txt the information to left of the number 1 are the file permissions. The first bit in the file permissions is the file type, the next 3 are the permissions of the owner, the following three bits are the permissions of the group, and the last three are the permissions of anybody who is either not in the group or not the owner. The last bit is a single character that specifies alternate access methods.
For instance, if you see "drwxr" it means that the file type is director, the r means that the owner can read the directory, the w means the owner can write to the directory, and x means the owner can execute the directory (since it's a directory it doesn't really get executed). The next 3 bits are the group rights. For testfile.txt, "r--" means that the group can read this but cannot write or execute.
There are two ways to modify the file permissions. They can either be done through numeric method or via a character method.