Basic Commands and Simple Shell Scripts
64
We can also switch from root to user:
[root@rhel-instance
]# su - userLast login Tue Feb 15 04:53:02 CET 2022 from 192.168.122.1 on pts/0[user@rhel-instance
]$As you can observe, it behaves
as if anew login was done, but within the same session. Now, let’s move onto managing the permissions for the different users in the system, as addressed in the following section.
Understanding users, groups, and basic permissionsMulti-user environments are defined by being able to handle more than one user simultaneously. But to be able to administer the system resources, two capabilities
help with the tasks Groups: Can aggregate users and provide permissions for them in blocks.
Each user has a primary group.
By default, a group is created for each user and assigned to it as a primary with the same name as the username
Permissions:
Assigned to files, determining which users and groups can access each file.
Standard Linux (and UNIX or POSIX) permissions include user, group, and others (ugo).
The whole system comes with a set of permissions assigned by default to each file and directory. Be careful when changing them.
There is a certain principle in UNIX that Linux has inherited everything is a file. Even when there maybe some
corner cases to this principle, it remains true on almost any occasion. It means that a disk is represented as a file in the system (in other words, such as /dev/sdb
mentioned in the installation, a process can be represented as a file (under /proc), and many other components in the system are also represented as files.
This means that, when
assigning permissions to files, we can also assign permissions to many other components and capabilities implemented by them by virtue of the fact that,
in Linux, everything is represented as a file.
Share with your friends: