LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't remove primary group in linux (https://www.linuxquestions.org/questions/linux-newbie-8/cant-remove-primary-group-in-linux-4175442688/)

thiyagusham 12-23-2012 11:31 AM

can't remove primary group in linux
 
Greeting to all;

Completely rearranging my local server. i can't remove existing primary group. we don't need existing primary group. how can i remove it ?

already i checkedhttp://="http://www.linuxquestions.o...-group-541476/also . kindly provide me how can i forcely removed oinstall group.

bijo505 12-23-2012 12:18 PM

Hi,
If the group is the primary group of any one of the user, system willn't allow you to remove the group.
if your old group is "Y" and that is the primary group of some users, create a new group "X" and move all the users from the group "Y" to the new group "X" and remove "y"

1) groupadd <new group>
2) egrep -i <old group> /etc/group # this will find out the users, who belongs to the group
3) then run 'id username' or 'groups usename' # this will show the users group info, if you find anyone of the users primary group is '<old group>' move that users to the new group using 'usermod -g <new groupname> user'

4) After moving users primary group to the new group, run groupdel <old groupname>

PS: If you want to disable the automatic groups creation while creating one user, check the /etc/login.defs file and comment out the gid section(Not recommended), but after that you need to specify the group manually while creating the account using useradd -g groupname
--
Thanks,
Bijo

thiyagusham 12-23-2012 12:30 PM

Hi bijo ;

Thanks for reply .
Quote:

# egrep -i oinstall /etc/group #
oinstall:x:500:
tim_hall.oinstall:x:544
# usermod -g y tim_hall
usermod: user tim_hall does not exist
Before post this thread i dropeed oracle user and tim_hall user.


All times are GMT -5. The time now is 08:57 PM.