Tuesday, February 28, 2012

How to add existing users in existing groups in linux and see which user is in which group


How to add existing users in existing groups in linux and see which user is in which group


Add to group:
[root@288832-web3 ~]# usermod -a -G group1 user1
[root@288832-web3 ~]# usermod -a -G group2 user2

View which group which user belongs:
[root@288832-web3 ~]# groups user1
user1 : user1 apache group1

[root@288832-web3 ~]# groups user2
user2 : user2 apache group2

No comments:

Post a Comment