Users and groups are used on GNU/Linux for access control that is, to control access to the system's files, directories, and peripherals. Linux offers relatively simple/coarse access control mechanisms by default.
1. By – Varnnit Jain
9990888972
Users And Groups In RHEL
2. Users
Every person that logs into the computer is considered as a
user.
Every user is assigned a unique user ID number (UID).
UID 0 identifies root.
User acccounts usually starts at UID 500.
1-499 UID is reserved for the system users.
Whenever you create any user in Linux It belongs to their
own group.
User names and UIDs are stored in /etc/passwd.
Users are assigned a home directory ( /home/username) and
a program that is run when they log in. (Usually a shell)
3. USERS
Users have full access to their directories.
User cannot read, write or execute each other
files without permission.
4. GROUP
A group is a collection of users which make easy
for administration to perform the task of
administration level.
When they need to apply permissions and
restrictions with the same level to many users ,
the such permissions an restrictions can be
applied to related groups.
Users are assigned to groups .
Every user is a member of at least one group and
possibly more.
Each group is assigned a unique group ID
number (GID).
5. GROUP
Each group is given their own private group
(primary group, usually the same name of the
user).
Users can be added to other groups.
User’s primary group is defined in the
/etc/passwd file.
User’s secondary group is defined in the
/etc/group file.
All users in a group can share files that belong to
that user.
6. In Command Line
#adduser username : Create a new user.
#passwd username : Change/set
password for user.
#groupadd groupname: create a new group.
#gpasswd groupname : Set Group Password.
#usermod –g groupname user name ,:Change
the primary group of the user
#usermod –G groupname username : Create a
secondary group for a user.
#usermod –a G groupname username : join user
in multiple secondary group but more steps are
required.
7. #usermod –l username : Lock user.
#usermod --lock username : lock user.
#passwd -S username : Want to see if the user is
ocked or not.
#usermod –U username : Unlock user.
#usermod –unlock username : Unock user.
#userdel –r username : Delete user wih its
directory.
#usermod –l newname oldname : Rename the user.
#gpasswd –a username groupname : Add user to
groups.
#gpasswd –d username groupname : Remove user
from group.