how to add Groups to system in linux

8:44 AM
how to add Groups to system in linux


Step1:how to add Groups to system in linux


Step2:The groupadd Command
puppy# groupadd sales


This will create the resulting group in the /etc/group file.


Step3:The gpasswd command provides a way to add users to groups via the command line and can also assign passwords to a particular group


To add users to a group, you would use the gpasswd command with the -a option.


puppy$ gpasswd -a bob sales




Step4:To remove a user from a group, you would use the -d option.


puppy$ gpasswd -d jane sales


Step5: To add a group administrator to a group, use the following command:


puppy# gpasswd -A bob sales


Step6:Or you can add both an administrator and users at the same time to a group using this command:


puppy# gpasswd -A bob -M jane chris david sales


Step7: The password will be stored in the /etc/gshadow file.


puppy# gpasswd sales
Changing the password for group sales
New Password:
Re-enter new password:

0 Comments