File Permission in Linux (Ubuntu)
In Linux, giving file permission is very important for your company's work. It helps you know the people that have access to a particular file when there is an issue or upgrade. It also makes accountability easy. It makes work easy to track.
File permission is distinguished into 3 access. which are
- Read (r): this permits a user to read the content. It allows directories to list their content.
- Write (w): it permits modification (create and delete) of files.
- Execute (x): it permits the execution of files. It makes directories access to files inside. r - 4 w - 2 x - 1
There is an individual right to file permission. Let us discuss who these individuals are
- u: this is the owner of an object. The owner has ability to write, read, and execute. i.e 421 =7
- g: group to which an object belongs
- o: all other users
- a: all users (u+g+o)
Anyone can be given access to any file at a particular time. Access can also be changed by using
This chmod helps to set user that owns the file
```chmod 777 file name
gives ability to all users
```chmod u+r, g+x file name
The above give user ability to read and group ability to execute. It goes on like that.
```chmod 750 file name
Owner has full permission; group has read and execute permission while others have 0 permission
Do not forget to switch to root by using the below command if your permission is denied
```sudo su