Group Management
1) The “groupadd” command creates a new group account
[root@MB327SCS068 ~]# groupadd netadmin
groupadd: group netadmin exists
[root@MB327SCS068 ~]# groupadd network
2) Adding users into network group
[root@MB327SCS068 ~]# useradd antony -g network
useradd: user antony exists
[root@MB327SCS068 ~]# useradd antonyraj -g network
[root@MB327SCS068 ~]# useradd ligory -g network
[root@MB327SCS068 ~]# useradd basha -g network
3) Setting and changing group password (gpasswd)
[root@MB327SCS068 ~]# gpasswd network
Changing the password for group network
New Password:
Re-enter new password:
4) Using “groupmod” command , we can change the group id (option -g) and name (-n)
[root@MB327SCS068 ~]# groupmod -n admin network
4) Deleting Group “groupdel” – You may not remove the primary group of any existing user. You must remove the user before you remove the group.
[root@MB327SCS068 ~]# groupdel admin
groupdel: cannot remove user’s primary group.
[root@MB327SCS068 ~]# userdel antonyraj
[root@MB327SCS068 ~]# userdel
usage: userdel [-r] name
[root@MB327SCS068 ~]# userdel ligory
[root@MB327SCS068 ~]# userdel basha
[root@MB327SCS068 ~]# groupdel admin
