LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2012, 09:39 AM   #1
Passmossis
LQ Newbie
 
Registered: Jul 2011
Location: USA
Distribution: RHEL 6.5
Posts: 28

Rep: Reputation: 2
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.
 
Old 01-16-2012, 01:38 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ 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.
 
Old 01-17-2012, 08:07 AM   #3
Passmossis
LQ Newbie
 
Registered: Jul 2011
Location: USA
Distribution: RHEL 6.5
Posts: 28

Original Poster
Rep: Reputation: 2
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?
 
Old 01-17-2012, 12:42 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ 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.

Last edited by T3RM1NVT0R; 01-17-2012 at 12:49 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
/var/log/wtmp Permissions berzerked Red Hat 3 10-05-2011 03:49 PM
Big Brother permissions with /var/log/messages Myiagros Linux - Software 1 05-06-2010 03:47 PM
/var/log/Xorg Permissions Reset During Re-Boot zcrxsir88 Linux - Security 1 01-28-2010 03:18 PM
setting file permissions for file /var/log/Xorg.0.log mfb Linux - Security 1 07-07-2009 02:41 PM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 05:13 PM


All times are GMT -5. The time now is 03:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration