I know this is a Linux 101 question, however I am unable to locate the answer in my O'Reilly Linux book: how to set the default for permissions when creating a new user. The default for the GUI in my newly installed Centos 5.5 is 700. I usually use 774.
And when root creates a new directory, is there a way to have a default there too?
Lastly, if root or someone with root privileges creates a sub-directory, is there a setting so that the sub-directory will have the owner/group and permissions as the parent directory?
Todd
On 03/25/11 4:45 PM, Todd Cary wrote:
I know this is a Linux 101 question, however I am unable to locate the answer in my O'Reilly Linux book: how to set the default for permissions when creating a new user. The default for the GUI in my newly installed Centos 5.5 is 700. I usually use 774.
And when root creates a new directory, is there a way to have a default there too?
man useradd man umask
On 3/25/2011 4:51 PM, John R Pierce wrote:
On 03/25/11 4:45 PM, Todd Cary wrote:
I know this is a Linux 101 question, however I am unable to locate the answer in my O'Reilly Linux book: how to set the default for permissions when creating a new user. The default for the GUI in my newly installed Centos 5.5 is 700. I usually use 774.
And when root creates a new directory, is there a way to have a default there too?
man useradd man umask
Thank you! Part of the challenge is knowing what to ask for
Todd
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
on 16:45 Fri 25 Mar, Todd Cary (todd@aristesoftware.com) wrote:
I know this is a Linux 101 question, however I am unable to locate the answer in my O'Reilly Linux book: how to set the default for permissions when creating a new user. The default for the GUI in my newly installed Centos 5.5 is 700. I usually use 774.
And when root creates a new directory, is there a way to have a default there too?
Lastly, if root or someone with root privileges creates a sub-directory, is there a setting so that the sub-directory will have the owner/group and permissions as the parent directory?
man adduser -> FILES -> /etc/login.defs
At login, umask is set by the shell initialization. Check ~/.bashrc, ~/.bash_profile, /etc/bashrc, and /etc/profile, for the usual suspects.
On Fri, Mar 25, 2011 at 7:45 PM, Todd Cary todd@aristesoftware.com wrote:
I know this is a Linux 101 question, however I am unable to locate the answer in my O'Reilly Linux book: how to set the default for permissions when creating a new user. The default for the GUI in my newly installed Centos 5.5 is 700. I usually use 774.
It's a user shell default setting, overridable with the "umask" setting.
And when root creates a new directory, is there a way to have a default there too?
Yes, reset the "umask" in root's /root/.profile for default login behavior. Getting it into non-login behavior may take a bit more work, and you may have to review and think about what your sudo settings do if you use sudo.
Lastly, if root or someone with root privileges creates a sub-directory, is there a setting so that the sub-directory will have the owner/group and permissions as the parent directory?
Please look into the "sgid" settings with the "chmod" command. And be aware that, if a user can write a file, they can reset its permissions unless you get *very* arcane with things like NFSv4 ACL's.