Home / UNIX / Users,Groups And Permissions In Linux

Users,Groups And Permissions In Linux

Users:

The operating system allows us to process the data between multiple users. Linux system uses the concept of the user account to manage the resources and files. The system maintains the user identification using user Id, user details, and password etc. A superuser root is used to manage the instruction as administrator. The user requires permissions. The root user is able to control the system configurations system file etc and the “#” symbol represents a command prompt. The General user also able to process the instructions and command and represent “$” symbol.

Groups:

It is the collection of users that maintain the permissions and file processing. The users are defined with similar permission in the particular group. Linux system maintains user identification number and group Id in a particular file that identified as ‘l’ etc ‘l’ group file.

Linux File Security:

security of file
image source:-https://technet.sector19.net

Linux operating system multiuser environment for processing the files and data between multiple users. So, need to secure the file and provide required permissions to the particular user that is known as file permission. The file permissions basically used to protect the contents and files to the unauthorized user that is known as file security. Linux system uses different groups and user and provides file security for managing the contents. The system admin grants the file permission or directory to access the contents to more than one group or users.

Permissions Types:

permissions types in linux
image source:-https://cdn.guru99.com

The files and directories are protected with particular permission.

1. Read Permission:

It is a type of permission that allows reading the contents of the file or in case of directories, the user can display created directories or files.

2. Write Permission:

In this type of permission, the user can modify the text from the file. In case of directories, the user can create new files or delete within the existing directories.

3. Execute Permission:

With this permission, the user can execute the program contents of shell script. In case of the directory, the user can rename and change the location of existing directories.

Examinee Permissions:

A command “ls-l” display the details of particular files or directories like permissions, username etc.

There is the following field of existing command:

1. File Type:

This field displays the type of the file like directory or file. Here, the identify directory and identify a file.

2. File Permission:

It is a second field that displays the permission in rwx like read, write, execute respectively. The and-identify absence of the permission. The permissions are defined in three groups like the owner, group and other respectively.

3. Link:

It display number of link files. It is basically used to identify the Alias(duplicate) of a particular file.

4. Ownership:

It is the fourth field that displays the owner of the file and another field display group of the file.

5. File Size:

It displays the size of the particular file.

6. File Access Time:

It displays the file modification or changes time.

7. Filename:

Interpreting Permissions:

The permissions are defined in the read-write-execute format. We can check the permissions using “ls-l” command and show its details. The system can interpret the permissions of the file then provide required privileges. The permission is defined by the admin to manage the file processing. Linux operating system interpreted the permissions in the form of rwx where to identify the absence of the permissions.

 

Permission Dependencies:

The permission granted to file also dependent on the permission of directory in with the file is located. It means the files are stored in the directory and the permissions are assigned on the directory. The file permission is dependent on the base of the directory. The files can be processed or display on the base of permission of directory. It is known as file dependencies.

Changing Ownership:

It is a way to change the ownership of the particular file. It means we can change the existing user or particular file to another user.

1. Chown Command:

It is a command that changes the ownership of the file. In this, we pass new user and file name as arguments. The permissions are also changed at the base of the owner.

Syntax:

chown∅user∅<filename>

Example:

chown kanna anna↵

Changing Permission:

It is a way to change the permission of the file on the base of user requirement. It means Linux system assigned the permission on the file as default but the user can change the permission of the existing on the base of requirement. There are different groups defined in an operating system like user, group and others we can define the permission in the form of rwx where (+) identify assigning the permission and (-) identify deny the permission.

1. Chmod Command:

It is a command that allows changing the permission of particular file on the base categories. In this, we pass category, permission and assign or deny symbol with a file name.

Category Permission Action
a(owner) read(r) +assign
g(group) write(w) -deny
o(other) execute(x) =absolute

Syntax:

chmod∅cat+/-perm∅filename

chmod ugo+rwd anna↵

chmod ugo-rw anna↵

chmod ug+r anna↵

rwx rwx rwx

2. Changing Permission With Numeric:

The permission can be changed on the base of numeric value. These values are defined in octal number where:

1-Read

2-Write

3-Execute

We use the numeric value for assessing the permission with chmod command it uses 1 number for an owner, 2 for group and 3 for other respectively we can also be combined the permissions like 5,6,7 etc.

Example:

chmod 777 anna↵

chmod 622 anna↵

3. Sticky Bit:

It is also a way to define the permission of files or directories. We can add a sticky bit to a directory to prevent the file within it’s from getting deleted. This bit add at first position of the permission. It basically identifies the permission of file or directory may be change. We can also display sticky bit with ls-l command.

File Ownership:

It is a way to identify username where the file is created it means the file and directories are created in a particular user and able to manage the processing like permissions, changing ownership etc.

1. Changing Group:

A group is a collection of users that provide a permission to manage the files or directories. Linux system allows us to change the group of the file to another group.

Chgrp:

It is a command that allows changing the group of the particular file. After it, the permission is also changed on the base of the existing group.

Syntax:

Chgrp∅<group name>∅<filename>

Chgrp anna koo↵

Default Permission:

Linux system creates files or directory and assigns and particular permission as default. It means the created file or directory contains the permission in the form of RWX but we can change the default permission the created file contains existing permission.

1. Unmask Command:

It is a command that allows setting default permission of the file or dir. In this we pass the numeric value like 1,2,4 for reading, write, execute respectively. This command omits the permission from the newly created file or directory.

example:

cat>ab↵

ctrl+d

ls-l ab↵

rwx–r–

unmask 122↵

-wxr-xr-x.

Changing Permission Using Nautless:

Linux system allows us GUI component to manage the file permission and changing the permission, group or owner. It provides a window in different option like the owner, group, permission, modification date and time of the file. We can set or change the permission using existing windows.

About Parichay

Check Also

Basic System Configuration In Unix

TCP/IP Network Configuration: It is a networking method that allows connecting more than one system …

Leave a Reply

Your email address will not be published. Required fields are marked *