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 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 or CentOS, the command would look like this:

[donnie@localhost ~]$ sudo useradd -G marketing cleopatra[sudo] password for donnie:[donnie@localhost ~]$ groups cleopatracleopatra : cleopatra marketing[donnie@localhost ~]$

On Debian/Ubuntu, the command would look like this:

donnie@ubuntu3:~$ sudo useradd -m -d /home/cleopatra -s /bin/bash -G marketing cleopatradonnie@ubuntu3:~$ groups cleopatracleopatra : cleopatra marketingdonnie@ubuntu3:~$

And, of course, I'll need to assign Cleopatra a password in the normal manner:

[donnie@localhost ~]$ sudo passwd cleopatra
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