Question

I would like to add a user(sachin) into a group(mqm). I would like add user by editing group file. Is it okay to add user name by editing group file like below

mqm:x:1000:clasic,gtcj,fgmmin,fddmin,sachin

when i fire command groups sachin i am getting output like below.

sachin : unix-sachin-g mqm

So adding user id sachin into mqm group is done ?

Was it helpful?

Solution

Yes it's ok to add user to /etc/group directly, but the common way is to use something like usermod:

sudo usermod -a -G mqm sachin

Note, group membership changes do not take effect for current user login sessions, requiring the user to reconnect to be affected by the changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top