User, Group and Permission in Linux

Linux is a multi-user operating system so we can create many users and groups in it. Linux is based on Unix concepts of file ownership and permissions; it provides us security for each and every file. In this case, study let’s have a look at some basics of a user, group, and permissions.

As we have learned that Linux is a multi-user system. The main motive of the users is to share the same computer resource individually. Every person login into the OS will be considered a user, they will get a username and user identification number (UID). Both username and UID should be unique. In Linux, we have a superuser that is known as a root user. Basically, the root user has the full whole and soul of the OS. As we got to know each user has a user identification number so the root user has UID 0 and the other user UID starts from 50. User name and UID are stores in the etc/passwd file.
All user has assigned a group to it. All the user from the same group has same access level to the file. Each group has its unique Group ID (GID). One user can be added to multiple groups. For example, we have one project which should be done by 10 users, and we have some files which we require for that project, so it is no feasible to give the same permissions to all the users in this scenario group be very handy.
Others in Linux are those who haven’t created the file nor are in any group who owned it. While giving permission to other we have to be carefully basically all the file who has all other permission is just public. So always have an eye on other permission on important or every file.
Linux Security.
As we all know how important is security in today’s world so let us have a look at how groups and users help us to secure the OS.
• Each file is owned by a UID and GID. It ensures that unauthorized people won’t access any file.
• If we run any process it runs as a UID or GID. It gives us an idea of who runs which process.
There are 3 types of permission:
1. Read: it basically gives access to that user to open and read the file.
2. Write: write permission give to a control of the file. Now the user can edit or alter some part of the file.
3. Execute: main file or program as .exe extension so if u have execute permission the only user can run that program.

Fig 1: permission of user group and other for a file


In this blog, we learned about what is difference user, group and other. and also what types of permission are there for any file.