Unable to find what you're searching for?
We're here to help you find itUNIX is a multi-user OS that many users can access simultaneously. Linux is pretty much a cloned version of UNIX that you can also use in servers and mainframes without modification. However, this brings up several security concerns since any unauthorised or malicious user can change, remove or corrupt sensitive data.
The existing file permissions in Linux make up a significant part of the OS’s defence against unauthorised user access. There are several security features in Linux systems, but granting local access can expose significant vulnerabilities. Therefore, it’s vital to assign the most accurate permissions to directories and files.
Every directory and file in Linux provides permissions in three user-based groups:
Files and directories in Linux have three basic types of permissions:
To view a file or directory’s permissions,
The permissions of a file or directory are displayed in the command line as follows:
_rwxrwxrwx 1 owner:group
The first character shown with an underscore is the special permission and varies with change.
The number or integer that is displayed after these characters refers to the number of hard links that a file has.
The final piece of the command is the assigning of Owner and Group, hence the formatting of Owner:Group.
To define permissions in Linux explicitly, you need to reference each Permission Type and Permission Group.
The permission Groups are denoted as:
Potential Assignment Operators used are plus (+) and minus (-), which tell systems whether to remove or add a specific permission.
The Permission Types are denoted as:
Consider an example. Imagine you are working with a file saved as ‘file1’ with existing permissions _rw_rw_rw. This means the file permissions to read as well as write are present for everyone - the owner, group and all users. If you want to remove the permission to read and write for ‘all users’, you must invoke the chmod command in Linux. More specifically, chmod a-rw file1. If you wish to grant this permission, you need to simply change the minus sign to plus, like chmod a+rw file1.
Also Read: Linux vs Windows: Which One Is The Best Choice For You?
To set file permissions using a binary reference, you need to understand that you can enter three numbers or integers to provide input. As a sample string of permissions, consider chmod 640 file1. This means the owner has permission to read and write, the group has permission to read, but the all user group has no permissions.
The first number represents owner permissions, the second one, group permissions and the last one denotes all other users’ permissions. These numbers provide a binary rwx string representation.
By adding these numbers, you will get the number or integer that represents the permissions you want to set. You must include binary permissions for each permission group there is.
Also Read: List of Best Linux Certifications in 2022
For Windows or Apple computer systems, you never really need to think about permissions at a personal level. That is because these operating systems don’t focus too much on user-based file rights, except at a corporate level. But the situation changes when you use a Linux-based system with permission-based file security. You can easily restrict access to files and directories as you please.
Take a look at some folders and documents you should focus on and the optimal permissions you should set up:
To know more about how Linux permissions work and how to navigate a Linux-based system, you can benefit from a Linux training course. Enrol in one on Koenig today.
Devpriyam is a Microsoft Certified Trainer with rich experience in Database Administration, System Administration, Oracle Applications, Troubleshooting, and Backup & Recovery concepts. I deliver training on various Database Systems Management tools.