how to add linux user to group?

Answers were Sorted based on User's Feedback



how to add linux user to group?..

Answer / vishal

Command is useradd UserName
Option -g ( For Primary Group)
-G ( For Seconday Group)

Is This Answer Correct ?    25 Yes 1 No

how to add linux user to group?..

Answer / anoop

useradd -g group_name user_name (for primary group)
useradd -G group_name user_name (For secondard group)

Is This Answer Correct ?    22 Yes 4 No

how to add linux user to group?..

Answer / d.veera

gpasswd -g username groupname

or

usermod -G groupname username

Is This Answer Correct ?    16 Yes 3 No

how to add linux user to group?..

Answer / vinayak

Second answer is wrong please use blow mentioned commond
usermod -g
usermod -G for secondary group
gpasswd -a

Is This Answer Correct ?    6 Yes 0 No

how to add linux user to group?..

Answer / §aikiran

the command used to add linux user to group is
#usermod -G groupname

Is This Answer Correct ?    5 Yes 0 No

how to add linux user to group?..

Answer / amit kumar ghosh

There are 2 types group in linux system.
1.primary
2.secondary
to add user to primary.
# useradd -g groupname username

to add user to secondary.
#useradd -G groupname username.

Is This Answer Correct ?    4 Yes 1 No

how to add linux user to group?..

Answer / §aikiran

Sorry, this is da correct command
the command used to add linux user to group is
#usermod -G groupname username

Is This Answer Correct ?    4 Yes 2 No

how to add linux user to group?..

Answer / ganesan

# usermod -g groupname username(for Primary Group)
# usermod -G groupname username(for Secondary Group)

Is This Answer Correct ?    2 Yes 0 No

how to add linux user to group?..

Answer / sudhakar.g

In /etc/group add the linux user( The user must be existin
linux box)

Is This Answer Correct ?    1 Yes 0 No

how to add linux user to group?..

Answer / ajay songare

New User Add to Grop
# username -g groupname username(for Primary Group)
# useradd -G groupname username(for Secondary Group)

Old User Add To Grop
# usermod -g groupname username(for Primary Group)
# usermod -G groupname username(for Secondary Group)

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Linux Commands Interview Questions

Linux system monitoring Tools?

6 Answers   HCL, IBM,


Is makefile a shell script?

0 Answers  


What is bash history linux?

0 Answers  


How do you create a blank file in linux?

0 Answers  


ls -l ls -t ls -r ls -a ls -ltr ls -u grep error file.txt grep -v error file.txt perl prg.pl | ./file.txt tee chmod +x chmod -x chmod =x ps bg date +%y%m%d ?

0 Answers   HP,






What does curl command do in linux?

0 Answers  


i dont know root password then this situation can we change or break root password to ant process

5 Answers  


What is build process?

0 Answers  


I have Laptop. I want to assign DHCP ip address, but in my Laptop having Wireless and with wire NIC cards, it is possible to assign reserve ip address for both NIC card, but same host name?

4 Answers   AOL,


why do u want to join this company

6 Answers   HCL, Infosys, United Healthcare, Wipro,


What command should you use to check the number of files and disk space used and each user’s defined quotas?

0 Answers  


how to see unallocated hard disk space on linux

12 Answers   HCL,


Categories