LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-23-2012, 12:31 PM   #1
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Rep: Reputation: Disabled
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.
 
Old 12-23-2012, 01:18 PM   #2
bijo505
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: Fedora & Ubuntu
Posts: 77

Rep: Reputation: 18
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
 
Old 12-23-2012, 01:30 PM   #3
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Primary Group greenleith Linux - Newbie 1 09-23-2011 04:58 AM
Secondary group users need to change the file permissions of primary group files? sunnybmv Linux - Newbie 3 12-10-2009 05:57 PM
what is primary group ram_rajavarapu Linux - Enterprise 2 01-23-2009 09:32 AM
groupdel: cannot remove user's primary group. leiw Linux - General 1 03-28-2007 11:12 PM
The Primary Group ? outshined Linux - Newbie 1 07-14-2006 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration