Showing posts with label add group. Show all posts
Showing posts with label add group. Show all posts

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

Add a new user to SVN for UKSS

Login as root via SSH on UKSS

Here we are adding a new user with the username: user1

Add new user: useradd user1
Add Password for the new user: passwd user1
Add user to groups: 
gpasswd -a user1 svn
gpasswd -a user1 apache