LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-22-2014, 10:43 AM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Question Creating files/directories a different group inherits it, how to change


Working with CentOS 7.

Whenever I create a file/directory as a standard user, that file/directory is inherited by the group Wheel, not the use that creates it.

That user though it part of the Wheel group and also has their own group under /etc/group.

Is there a way to change this, so that when a user creates a file/directory, the owner is their group, not the Wheel group?

thanks
 
Old 11-22-2014, 10:56 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
What is this user's primary group (the one listed in /etc/passwd and shown by the "id" command as "gid=nnn(name)"?
Is that behavior happening all over the system, or just in one particular directory? The only time a newly created file should inherit the GID of the directory is when that directory has the "set GID" bit set in its permissions (e.g., "drwxrwsr-x").
 
Old 11-22-2014, 11:00 AM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Here is the output of two commands: id and grep of /etc/passwd

Code:
id cmmiller ; cat /etc/passwd | grep cmmiller
uid=1000(cmmiller) gid=10(wheel) groups=10(wheel), 1000(cmmiller)
cmmiller:x:1000:10:cmmiller:/home/cmmiller:/bin/bash
 
  


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
[SOLVED] Default owner and group of auto-generated files and directories tmad40blue Linux - Server 5 09-05-2013 12:30 PM
how to change files group but only if they belong to specified group ? froff Linux - General 5 12-17-2011 01:51 PM
Secondary group users need to change the file permissions of primary group files? sunnybmv Linux - Newbie 3 12-10-2009 04:57 PM
Creating a script to move or copy files into multiple directories below the files matthes138 Linux - Newbie 5 08-25-2009 04:57 PM
permissions for group files/directories transferred from Netware mweil Linux - Newbie 1 07-01-2004 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 10:27 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