Learn how to Manage Users and Groups in Red Hat Linux Part 3

0
1214
Learn-how-to-Manage-Users-and-Groups-in-Red-Hat-Linux-Part-3-740X296

Learn-how-to-Manage-Users-and-Groups-in-Red-Hat-Linux-Part-3-740X296
Deleting User Accounts
If a user has left the firm, so why to keep his/her account any longer? As a security rule: when an employee is no longer authorized to use or access the system (whatever the reason is: resignation, firing, or transfer), the access credentials for this employee should be removed. For this reason, there should be a way to delete a user account. In this section, we will learn how to do it using both methods: GUI and using shell commands.

Deleting User using the User Manager
In the User Manager window, select the user you want to remove, and click the Delete button in the toolbar.
Img1
When asked, click Yes to confirm user deletion.
Img2
The user is deleted.
Img3
Using the userdel Command
Syntax

Example
To delete the user karim, and delete its home directory:
Img4

Understanding Groups
The definition from Red Hat:

“A group is an organization unit tying users together for a common purpose, which can be reading permissions, writing permission, or executing permission for files owned by that group.”

A Red Hat Linux group has:

  • A unique name.
  • A unique group ID GID.
  • A list of members, users which are members of this group.

Displaying Existing Groups
To view the existing groups, simply display the contents of the /etc/groups file:
Img5
Or, using the User Manager tool:
Img6
As you remember, the User Manager by default hides the built-in system users and groups. That is why you see only two groups. To display all groups including system groups, from the Edit menu click Preferences. In the Preferences dialog box, uncheck the Hide system users and groups check box.
Img7
Now, all groups are displayed:
Img8

Creating New Group
Again, you have the choice either to do the job using the graphical tool, or from the command-line shell.

Using the User Manager
In the User Manager window, click the Add Group button in the toolbar. In the Add New Group dialog, type the group name, and click OK:
Img9
The group is created and assigned a GID of 503.
Img10
Using the groupadd Command
To create a new group, use the groupadd command.
Syntax
In its simplest form, the groupadd command requires only the group name as an argument:

Example
To create the oinstall group (usually required for Oracle installation):
Img11

Manual Assignment of GID
To assign the GID for the new group manually, check the Specify group ID manually check box and type the GID in the textbox:
Img12
Or, use the –g option of the groupadd command:

Either methods will assign the GID manually:
Img13

Modifying Groups
To modify an existing group using the User Manager tool, select the group to edit, and click the Properties button in the toolbar:
Img14
In the Group Properties dialog, you can modify the group name and the users’ membership in this group:
Img15
Change the group name if you want, and click OK.
Img16
This should be reflected immediately in the group list:
Img17

Using the groupmod Command
The groupmod command is used to modify group properties.
Syntax

To change the group name:

To change the group ID:

Examples

  • To change the name of the finance group back to sales:
    Img18
  • To change the group ID of the sales group from 4444 to 5555:
    Img19

Adding Users to a Group
From the User Manager, open the properties window for the group you want to add users in. Select the Group Users tab.
Img21
In this tab, you should see the list of users existing in the system. From this list select user(s) that need to be members of this group.
Img22
When finished, click OK.
Now, these users are now member of the sales group.

Summary

  • When a user account is longer needed, delete it.
  • To delete a user account, use the userdel command.
  • A group is an organizational unit tying users together for a common purpose.
  • To add a new group, use the groupadd command.
  • To modify the properties of a group, use the groupmod command.

In the next article, we will continue with Groups. See you.

LEAVE A REPLY

Please enter your comment!
Please enter your name here