how to add linux user to group?

Answers were Sorted based on User's Feedback



how to add linux user to group?..

Answer / dk

useradd -g (Groupname-g1) (Username-u1)
Ex:
#useradd -g g1 u1

Is This Answer Correct ?    3 Yes 3 No

how to add linux user to group?..

Answer / ron

useradd -g primary_group -G secondary_group username
passwd password

Is This Answer Correct ?    1 Yes 1 No

how to add linux user to group?..

Answer / pramod kumar mohapatra

gpasswd -M username grpupname

Is This Answer Correct ?    0 Yes 0 No

how to add linux user to group?..

Answer / 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

how to add linux user to group?..

Answer / ayjaz khan

by the command

#groupadd <groupname>

Is This Answer Correct ?    10 Yes 11 No

how to add linux user to group?..

Answer / v.balaviswanathan

groupadd EXAMPLE

useradd -G EXAMPLE <username>

Is This Answer Correct ?    1 Yes 2 No

how to add linux user to group?..

Answer / ajay songare

linux create a Two type of Group thare are:-
1.primary group represent g
2.secondary group represent G

# useradd -g groupname username
# useradd -G groupname username

usercreate and after that Add group

# usermod -g groupname username
# usermod -G groupname username

Is This Answer Correct ?    1 Yes 2 No

how to add linux user to group?..

Answer / d.veera

command is useradd username

Is This Answer Correct ?    9 Yes 15 No

Post New Answer

More Linux Commands Interview Questions

How do you list all the files in a directory, including hidden files?

1 Answers  


What the command used for list the contents of your home directory, current directory and all subdirectories?

0 Answers  


What is ls command and what it does?

0 Answers  


How can you copy lines into the buffer in command mode?

0 Answers  


Which command will show you free/used memory?

0 Answers  


What are the examples of simple command?

0 Answers  


tell me something about linux commands.

0 Answers   Ericsson,


Did you ever write any inerface files / profile file to support unix environment setup ?

1 Answers   HP,


How do I check my disk space?

0 Answers  


What does curl command do in linux?

0 Answers  


Does linux cp command overwrite?

0 Answers  


What does the following command line produce? Explain each aspect of this line. $ (date ; ps -ef | awk {print $1}' | sort | uniq | wc -l ) >> Activity.log

4 Answers   Cisco,


Categories