Linux Command line Beginner question

How do I:

see what groups a user is part of from the commmand line
add another user to the same group from the command line
Jack_son_Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
OHUPEConnect With a Mentor Commented:
An alternative way is to type :

groups username

to check out what groups username is part of.
And type :

gpasswd -a username group

to add username to the group group
0
 
farzanjConnect With a Mentor Commented:
As said above, you can see all the group information by issuing command

id <userid>

If you have existing user and you want to add group to the profile you can do
usermod -g <primary group> -G <secondary groups separated by commas>

Make sure you give all the group names, even exiting groups
0
All Courses

From novice to tech pro — start learning today.