Managing Groups from the Command Line
groupadd
As you can probably guess from its name, the groupadd utility is used to add
groups to your Linux system. The syntax for using groupadd at the shell prompt is relatively
simple. Just enter
groupadd options groupname
For example, if I wanted to add a group named dbusers, I would enter
groupadd dbusers
at the shell prompt.
When I do, a group is added to
/etc/group
using default parameters specified in
/etc/login.defs
When using groupadd, you can override the defaults in
/etc/login.defs
and customize the way the group is created using the following options:
• –g
Specifies a GID for the new group.
• –p
Specifies a password for the group. Just as with the useradd command, you must use
the
openssl passwd –crypt
command to first encrypt the password you want to use with the –p option of groupadd.
• –r
Specifies that the group being created is a system group.
LX0-104 Exam Objectives (K)
No comments:
Post a Comment