Skip to Content
Mastering Linux Security and Hardening
book

Mastering Linux Security and Hardening

by Donald A. Tevault
January 2018
Intermediate to advanced
376 pages
8h 45m
English
Packt Publishing
Content preview from Mastering Linux Security and Hardening

Adding users to a group by editing the /etc/group file

This final method is a good way to cheat, to speed up the process of adding multiple existing users to a group. First, just open the /etc/group file in your favorite text editor, and look for the line that defines the group to which you want to add members:

. . .marketing:x:1005:cleopatra,maggie. . .

So, I've already added Cleopatra and Maggie to this group. Let's edit this to add a couple more members:

. . .marketing:x:1005:cleopatra,maggie,vicky,charlie. . .

When you're done, save the file and exit the editor.

A groups command for each of them will show that our wee bit of cheating works just fine:

[donnie@localhost etc]$ sudo vim group[donnie@localhost etc]$ groups vickyvicky : vicky ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Security and Hardening, The Practical Security Guide

Linux Security and Hardening, The Practical Security Guide

Jason Cannon
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781788620307Other