LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
LinkBack Search this Thread
Old 07-12-2005, 04:35 AM   #1
bnarenderraju
LQ Newbie
 
Registered: Jul 2005
Posts: 3

Rep: Reputation: 0
Problem to remove a user from group in fedora core 3


Hi all,

I have a problem in removing user from a group in fedora core 3.. i had users "usermod -G groupname username" for adding user to a group.

But in fedora i couldn't find any command to remove a user from a group in fedora core. ... if anyone knows please help me out...


Last edited by bnarenderraju; 07-12-2005 at 04:36 AM.
 
Old 07-12-2005, 04:52 AM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
You can do this in many ways. One is to edit the /etc/passwd file and look for the user you need. See the names of the groups and just delete the one you don't want him to be part of.

The other way of using the usermod -G command is to use the usermod -G list_of_groups_you_want_the_user_to_be_part_of. and just leave the group you don't want him to be part of out of the list.

And the easiest of all is to use the user toolsthat are part of KDE or GNOME.
 
Old 07-13-2005, 12:00 AM   #3
bnarenderraju
LQ Newbie
 
Registered: Jul 2005
Posts: 3

Original Poster
Rep: Reputation: 0
problem to remove user from group, in fedora core 3

Hi Marghorp,

Thanks for your mail... problem here i am facing is i couldn't find a command using which i can remove user form a group.
In SUSE 9.2 we have the command "groupmod -R user group", but in redhar we have the groupmod only for remaning the groupname of a particular grpid.

But in redhat for adding user to a group we can use the command "usermod -G group user".. smae will also work in SUSE 9.2.....

is there any command in redhat/fedora core 3 which can remove user from a group from command line ....

advance thanx,
Naren
 
Old 07-13-2005, 02:54 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,165
Blog Entries: 4

Rep: Reputation: 426Reputation: 426Reputation: 426Reputation: 426Reputation: 426
Moved: This thread is more suitable in Fedora and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 07-13-2005, 05:05 PM   #5
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
Yes, usermod can change the users groups belonging. when you use usermod username -G list_of_groups you tell the system, which groups the user belongs to.

Just type in the list the user belongs to and leave the ones you don't want the user to belong to, out of the list.
 
Old 07-14-2005, 05:11 AM   #6
bnarenderraju
LQ Newbie
 
Registered: Jul 2005
Posts: 3

Original Poster
Rep: Reputation: 0
You are right marghorp,

but It will be problem when i want to remove a user which is a member of about 300 groups ... then i have to concat the list of groups which i don't want to change and pass it to usermod -G ... which is like more memory consuming at the time executing th command when we pass the usermod -G "grp list" user to a system() fn.....

i was looking if there is any other command in FC3 like groupmod -R which is available in SUSE Linux fro removing a user from a group..... also a command in FC3 for adding user to group like groupmod -A in SUSE

Last edited by bnarenderraju; 07-14-2005 at 05:12 AM.
 
Old 07-14-2005, 05:27 AM   #7
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
The only easy way is using a text editor to edit the /etc/passwd file. Open the file, search for the username and then delete the group from that line. Every user has his own line, i believ it something like username:UID:GID:groups:shell:home_directory.

Maybe I'm mistaken, but isn't there, where you can edit each user. Or can you only edit the users initial group...
 
Old 07-20-2005, 09:32 AM   #8
tommyr1216
Member
 
Registered: Sep 2004
Location: Pennsylvania
Distribution: Gentoo, Suse, Fedora, Slackware
Posts: 56

Rep: Reputation: 15
If you want to do this by editing a file, you should edit /etc/group, not /etc/password. At the end of each group definition, there is a list of members of that group. Simply remove the username from the group.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
user account for fedora core 3 lbotes Linux - Newbie 4 03-02-2005 01:06 PM
KickStart fedora core 3 minimal exclude @base group mhiggins Fedora 1 01-31-2005 12:58 AM
Trying to remove Yahoo messanger from Fedora Core 2 adingman99 Linux - Software 4 08-20-2004 11:23 AM
Old Redhat user, which fedora core to choose? Flak Pyro Fedora 2 05-30-2004 08:57 PM
New Linux/Fedora Core 1 user questions Makaelin Fedora 7 04-01-2004 10:52 AM


All times are GMT -5. The time now is 05:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration