LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RHEL 5 /var/log created permissions (https://www.linuxquestions.org/questions/linux-newbie-8/rhel-5-var-log-created-permissions-924036/)

Passmossis 01-16-2012 08:39 AM

RHEL 5 /var/log created permissions
 
I'm looking for information about the creation permissions for files within /var/log.

One of the specifics is /var/log/gdm/ files. The created permissions of these log files is 0644. I am looking to set these files to 0600 or 0640.

Another log file who's permissions I cannot find the source permissions is: /var/log/Xorg.0.log. Again, I'm looking to change it from 0644 to 0600 or 0640.


I could create a script to update these files, but I would prefer to know the source of the file permissions and correct it there. Thank you for your time.

T3RM1NVT0R 01-16-2012 12:38 PM

@ Reply
 
Hi Passmossis,

Permissions are derived from /etc/bashrc.

If you will run the following command:

Code:

less /etc/bashrc
At the beginning itself you will find the following lines:

Code:

# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
    umask 002
else
    umask 022

Which in simple terms translates to: Any file created by a normal user will have umask value of 002 which inturn result in the permission 664. And any file created by a root user or system user will have umask value of 022 which in turn result in the permission 644.

So to answer your query I would say that creation permission derives from /etc/bashrc.

Passmossis 01-17-2012 07:07 AM

Thanks for the reply. This is where I was looking as well.

I have the file configured as:

Code:

# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 99 ] && [ "`id -gn`" = "`id -un`" ]; then
    umask 077
else
    umask 077


I'm still left with the same results. Any other potential areas to look?

T3RM1NVT0R 01-17-2012 11:42 AM

@ Reply
 
If you will set 066 it will be suffice. Then it will automatically work as rw------- for files and rwx--x--x for directories. So you can change them to 066 if you want.

Changes will not work until you reboot your system.


All times are GMT -5. The time now is 07:31 PM.