Tuesday, January 20, 2015

To add existing user to groups in linux environment

OK, now we know how to add new user to the group. but what if you have an existing user and want to add to new group?
If you want to add existing user to a group and this group become the primary group for the user following is the syntax:
usermod -g

Example:
usermod -g dba oracle

What if you want to add this user to several group?
usermod -G
Take note: groupname is separated with comma and without space


Example:
usermod -G dba,dgdba,backupdba oracle

To check if it is registered successfully, use this command:
cat /etc/gshadow

Take note: System need to be rebooted.

No comments:

Music Scales

Scale is a sequence of musical notes with specific order. There are few types of scale such as pentatonic (5 notes) and diatonic (7 notes). ...