how to add linux user to group?

Answer Posted / shanu

 gpasswd
Usage: gpasswd [-r|-R] group
       gpasswd [-a user] group
       gpasswd [-d user] group
       gpasswd [-A user,...] [-M user,...] group
#gpasswd -a user1 dba
Adding user user1 to group dba
#gpasswd -M user2,user3 dba //multiple users

or

#usermod -g primary_grp username
#usermod -g dba user1

#usermod -G sec_grp username
#usermod -G oper,oinstall oracle

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You have a tab delimited file called phonenos and want to change each tab to four spaces. What command can you use to accomplish this?

560


Is cmake a compiler?

603


What is file and example?

614


What is ulimit in linux?

574


What is the root directory linux?

506






What is ulimit command?

613


What is gnu in linux?

533


How cp command works in linux?

541


How do I permanently set ulimit in linux?

526


How do you do nslookup?

539


What does chmod do in linux?

548


What Command used to lock user password?

589


What is the ipconfig command for linux?

527


How you will create new folder / directories and how to remove file and folder in linux?

484


How does grep work in linux?

523