Managing groups and reviewing assignments
We have seen how to create a group with groupadd
and delete it with groupdel
. Let's see how to modify a created group with groupmod
.
Let's create a group to work with. We will create the misspelled acounting
group by running the following:
[root@rhel8 ~]# groupadd -g 1099 acounting [root@rhel8 ~]# tail -n1 /etc/group acounting:x:1099:
You see we made a mistake in the name by not spelling it accounting
. We may even have added some user accounts to it, and we need to modify it. We can do so using groupmod
and running the following:
[root@rhel8 ~]# groupmod -n accounting acounting [root@rhel8 ~]# tail -n1 /etc/group accounting:x:1099:
Now we've seen how we modify the group name. We can modify not just the name but the GID by using the -g
option:
[root@rhel8 ~]# groupmod -g 1111 accounting [root@rhel8 ~]# tail -n1 /etc/group accounting:x:1111:
We can see which groups are assigned to a user by running the groups...