Reader small image

You're reading from  Mastering Linux Security and Hardening - Third Edition

Product typeBook
Published inFeb 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781837630516
Edition3rd Edition
Languages
Tools
Right arrow
Author (1)
Donald A. Tevault
Donald A. Tevault
author image
Donald A. Tevault

Donald A. Tevault - but you can call him Donnie - got involved with Linux way back in 2006, and has been working with it ever since. He holds the Linux Professional Institute Level 3-Security certification, and the GIAC Incident Handler certification. Donnie is a professional Linux trainer, and thanks to the magic of the internet, teaches Linux classes literally the world over from the comfort of his living room. He's also a Linux security researcher for an IoT security company.
Read more about Donald A. Tevault

Right arrow

Creating a user group and adding members to it

So far, I’ve been doing all of the demos inside my own home directory, just for the sake of showing the basic concepts. But the eventual goal is to show you how to use this knowledge to do something more practical, such as controlling file access in shared directories.

Let’s say that we want to create a marketing group for members of—you guessed it—the marketing department:

[donnie@localhost ~]$ sudo groupadd marketing
[sudo] password for donnie:
[donnie@localhost ~]$

Let’s now add some members. We can do that in three different ways:

  • Add members as we create their user accounts.
  • Use usermod to add members that already have user accounts.
  • Edit the /etc/group file.

Adding members as we create their user accounts

First, we can add members to the group as we create their user accounts, using the -G option of useradd. On Red Hat, AlmaLinux, or CentOS, the...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Linux Security and Hardening - Third Edition
Published in: Feb 2023Publisher: PacktISBN-13: 9781837630516

Author (1)

author image
Donald A. Tevault

Donald A. Tevault - but you can call him Donnie - got involved with Linux way back in 2006, and has been working with it ever since. He holds the Linux Professional Institute Level 3-Security certification, and the GIAC Incident Handler certification. Donnie is a professional Linux trainer, and thanks to the magic of the internet, teaches Linux classes literally the world over from the comfort of his living room. He's also a Linux security researcher for an IoT security company.
Read more about Donald A. Tevault