Know your rights
The most basic security mechanism in Linux is based on defining a combination of rights for a set of entities. The rights are as follows:
read
write
execute
(read contents when talking about a directory)
And the entities are as follows:
- The owner of the file or directory
- The group that owns the file or directory
- All the other users and groups
This is a crude security system. It’s sufficient for small servers and desktop uses but, for more complex setups, it is sometimes too restraining. There are other additional systems, such as Access Control Lists (ACLs), AppArmor, SELinux, and more. We are not going to cover them in this book.
With the use of the previous systems, we can still achieve quite a lot regarding our system security.
How do those rights and ownership work? We use the ls
command (list files and directories):
admin@myhome:/$ ls -ahl total 36K drwxr-xr-x 3 admin admin 4.0K Aug 20 20:21 . drwxr...