Connect with us

Hi, what are you looking for?

Linux

How to Create and Edit User and Group on CentOS 7

Linux User and Group Administration with Details

Linux User Administration

Users
  • In computing, a user is a person who uses a computer or internet service.
  • A user will have a user account that identifies the user by a username.
  • To log on to a system, a user is required to authenticate himself with a password for the purposes of accounting, security, logging, and resource management.
User private group (UPG) Scheme

When a user is crested a group with the same name as the username is also created.

  • This becomes the primary group for that user.
  • A user can have only one primary group.

When a user is created in Linux/ UNIX, the following are also created by default:

  • Home directory /home/[username]
  • Mail account /var/spool/mail/[username] (if mail services are running)
  • Unique user identifier (UID) and group identifier (GID)

Types of User

There are two types of user

  1. Super User
  2. Normal User
Users Database Files

The information regarding the user is stored in the following files:

  • /etc/passwd
  • /etc/shadow
Content of /etc/passwd
  • The information of each user created is stored in a separate line in the file /etc/passwd.
  • Each record has seven fields separated by a.
as given :-
ravi:x:500:500:prog:/home/ravi:/bin/bash
 1 : 2: 3 : 4 : 5 : 6 : 7

1= user name
2= Mask password
3= UID
4= GID
5= Comment
6= Home directory
7=Shell

Content of /etc/shadow
  • This file contain the encrypted user password
  • Password are encrypted using MDS (Message Digest Version 5) Algorithm
Creating user
Adding a user
[root@techbrown~]# useradd <username>
[root@techbrown~]# useradd<option> <arguments><username>
Options

-u UID
-g primary grpname/GID
-o Override
-G Secondary group
-c Comment
-d Home directory
-s Shell

User Password
Creating or changing a user password
[root@techbrown~]# passwd <username>

Linux Group Administration

Group

Group is a collection of user to whom the sane permissions are to be applied.
There are two types of groups

  • Primary
  • Secondary
Group Database Files

The information regarding the groups are stored in the following files:

  • /etc/group
  • /etc/gshadow
Content of /etc/group
  • The information of each group created is stored in a separate line in the file/etc/group
  • Each record has four fields separated by.
as given:-
ravi:x:500:sachin,kumar
1 :2: 3 : 4

1 = Group name
2 = Encrypted password
3 = List of administrative members
4 = list of members

Content of etc/gshadow
  • This file contains the encrypted group password
  • Passwords are encrypted using MDS (Message Digest Version 5) Algorithm
ravi:hjkadfyhs8:admin:sachin,kumar

1 : 2 : 3 : 4
1 = Group name
2 = Encrypted Password
3 = List of administrative members
4 = List of members

Creating a Group

Creating a group
[root@techbrown~]# groupadd <group name>
[root@techbrown~]# groupadd <option> <arguments> <grpname>

Options
-g GID
-o Override

Modifying a Group

Modifying a group
[root@techbrown~]# groupmod <option> <arguments> <grpname>

Options
-g GID
-o Override
-n Group name

Deleting a Group

Deleting a group
[root@techbrown~]# groupdel <group name>

Note : A group cannot be deleted if it has primary members.

Group Membership

Group membership
[root@techbrown~]# gpasswd <option> <arguments> <grpname>

Options
-M Add multiple users to the group
-A Adds a group administrator
-a Add a user to the group
-d Delete a user from the group

Advertisement. Scroll to continue reading.

Managing User and Groups Using (GUI)

Managing users and group using (GUI)
[root@techbrown~]# System-config-users &

Congratulations now, you have learned Linux User and Group Administration with Details.You’re now ready to use the Linux User and Group Administration on your Linux systems.

Comments
Advertisement
Advertisement

Linux

In this tutorial we will configure ISCSI Target Server on CentOS 8 / RHEL 8. ISCSI stands for Internet Small Computer Systems Interface.  This...

Linux

In this tutorial we will configure SELinux Modes on CentOS 8 / RHEL 8. SELinux stands for Security-Enhanced Linux and it is developed by...

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Linux

If you forget a root password of your RHEL 8 and CentOS 8 and want to reset the password so that the RHEL 8...

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Windows

Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...