LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-10-2007, 10:18 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Changing Group


I am trying to change a users group - and for some reason it does not seem to work.

Code:
drwx------    3 ttrimble        ttrimble     4096 Oct 20 14:02 ttrimble
Here you can see this user has a group same as his username.

I am trying to change this but is not working. What am I doing wrong?

Code:
usermod -g fcat -G users ttrimble
I am trying to specify user ttrimble have a primary (-g) group of fcat and also be part of (-G) users group.

It does not seem to work.
 
Old 01-10-2007, 10:42 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have a look in /etc/group to see which users are members of which groups.

Haven't you simply posted the output of ls -l? All this is showing is that the directory ttrimble is owned by user ttrimble and group ttrimble and reflects your grouping at the time ttrimble created the directory (changing the user's groups won't change file ownerships). I assume that the group ttrimble still exists, even if the user ttrimble doesn't belong to it.

If you want to change the group, simply use

chown :fcat /home/ttrimble

or whatever the relevant path is. You can use the -R option to change all subdirectories and files within /home/ttrimble if you want

Last edited by billymayday; 01-10-2007 at 10:47 AM.
 
Old 01-10-2007, 11:54 AM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
I guess I don't understand groups that well. I have a user "ttrimble" on a server and I want to make his primary group "fcat" but I also want him to have access to some folders that can only be accessed by the "cvs" group. I would assume I could also make him a member of "cvs" while he maintains "fcat" as his primary or default group, no?

How can I verify what group(s) "ttrimble" is currently a member off and then secondly - how would I usermod the above scenario in a correct CLI syntax?

I looked in /etc/group but there are so many users - is there no other way simply list a specific user and have Linux output all of the specified users known groups?
 
Old 01-10-2007, 01:17 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
You can change a users primary group but that won't change existing ownerships on files already in place.

You'll need to use the chown command to change any existing groups you want his new group to own.

And like said before, you may just want to add him to the group that has access to cvs, etc.

You can see current groups by doing an "id" on his username:

id ttrimble
 
Old 01-10-2007, 01:21 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
I found out that if I run the command:

Code:
[root@lt2fs1 User Folder]# groups cwilliams
cwilliams : wheel ctia
You can see I am a member of the wheel group and also a member of "ctia" which answers my question above .

It looks like it is now working with the usermod command - I was just looking in the wrong place.

Thanks!
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing group id within a script mbusche Linux - Software 3 03-29-2006 08:24 AM
changing group twallstr Linux - Newbie 2 09-11-2005 03:00 PM
Changing group in Konqueror? miscreant Linux - Software 1 07-08-2005 05:42 PM
Changing user's group? orange400 Linux - General 2 06-18-2004 04:30 AM
changing the group anwar_lpk Linux - Networking 2 05-08-2003 10:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:53 PM.

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
Open Source Consulting | Domain Registration