Managing Groups from the Command Line
groupmod
You may have noticed that the groupadd command didn’t add one key component to the new group: users! What good is a group if you don’t have any users occupying it?
To modify a group, including adding users to the group membership, you use the groupmod
utility. The syntax for using groupmod is similar to that used by usermod. Enter
groupmod options group
at the shell prompt. You can use the following options with the command:
• –g
Changes the group’s GID number.
• –p
Changes the group’s password. Just as with the usermod command, you must use
the
openssl passwd –crypt
command to first encrypt the password you want to use with the –p option of groupmod.
• –A
Adds a user account to the group.
• –R
Removes a user account from the group.
For example, if we wanted to add ksanders to the dbusers group, we would enter
groupmod –A “ksanders” dbusers
at the shell prompt.
LX0-104 Exam Objectives (K)
No comments:
Post a Comment