LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-10-2011, 01:23 AM   #1
hks1233
Member
 
Registered: Nov 2010
Posts: 30

Rep: Reputation: 1
permission error on /var/log/messages


Hi

I cannot make any permission change on /var/log/messages.Currently the permission looks like

?r---ws--t 58243 115 59053 1358438049 Jan 10 10:55 /var/log/messages


How can i change the permission to root. Already chown failed giving a permission failed error.
 
Old 01-10-2011, 01:46 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

Looks like you have the 'sticky bit' set on your messages file. That means that only the owner and users with write permissions can modify that file. What also strikes me as strange is that you have numerical IDs instead of the regular username:group combination. Did you by any change get the permissions with ls -ln. Try ls -l to see the username of the owner. Try as root to remove the sticky bit with:
Code:
chmod -t /var/log/messages
Kind regards,

Eric
 
Old 01-10-2011, 02:23 AM   #3
hks1233
Member
 
Registered: Nov 2010
Posts: 30

Original Poster
Rep: Reputation: 1
Hi

Output for ls -ln
?r---ws--t 58243 115 59053 1358438049 Jan 10 10:55 messages

Output for ls -l
?r---ws--t 58243 115 59053 1358438049 Jan 10 10:55 messages

Output for chmod -t /var/log/messages
chmod: changing permissions of `/var/log/messages': Operation not permitted

No idea why this happens

Waiting for a help
 
Old 01-10-2011, 02:27 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

As what user did you try the chmod command? Can you execute the following and post the output:
Code:
stat /var/log/messages
Kind regards,

Eric

Last edited by EricTRA; 01-10-2011 at 02:35 AM.
 
Old 01-10-2011, 02:40 AM   #5
hks1233
Member
 
Registered: Nov 2010
Posts: 30

Original Poster
Rep: Reputation: 1
Hi

as root

Output for stat /var/log/messages

File: `/var/log/messages'
Size: 1358438049 Blocks: 4022424563 IO Block: 4096 weird file
Device: 803h/2051d Inode: 6968287 Links: 58243
Access: (3431/?r---ws--t) Uid: ( 115/ UNKNOWN) Gid: (59053/ UNKNOWN)
Access: 2011-01-10 10:55:39.000000000 +0530
Modify: 2011-01-10 10:55:39.000000000 +0530
Change: 2011-01-10 10:55:39.000000000 +0530

Last edited by hks1233; 01-10-2011 at 02:43 AM.
 
Old 01-10-2011, 03:16 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Something is terribly wrong with your system in my opinion. Stat only shows the numerical ID. Can you execute the following as root:
Code:
id
and post the output. That should show some information about group membership and account information. Also the following:
Code:
cat /etc/passwd | grep 115
cat /etc/group | grep 59053
To see if there's a reference in your account files.

Kind regards,

Eric
 
Old 01-10-2011, 03:29 AM   #7
hks1233
Member
 
Registered: Nov 2010
Posts: 30

Original Poster
Rep: Reputation: 1
Hi

Output for id

uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

No result for
cat /etc/passwd | grep 115
cat /etc/group | grep 59053
 
Old 01-10-2011, 03:36 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

What are the permissions on your /var/log folder:
Code:
ls -l /var | grep log
Kind regards,

Eric
 
Old 01-10-2011, 03:46 AM   #9
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Quote:
Originally Posted by hks1233 View Post
Hi

I cannot make any permission change on /var/log/messages.Currently the permission looks like

?r---ws--t 58243 115 59053 1358438049 Jan 10 10:55 /var/log/messages


How can i change the permission to root. Already chown failed giving a permission failed error.
I think its attribute has been changed, try running the following command:

Code:
#chattr -i /var/log/messages
Now try changing the permissions again, good luck.
 
1 members found this post helpful.
Old 01-10-2011, 03:59 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by sayan_acharjee View Post
I think its attribute has been changed, try running the following command:

Code:
#chattr -i /var/log/messages
Now try changing the permissions again, good luck.
Hi,

You might have a good point here. Didn't think of that one yet (Monday, Monday, ...). List the attributes using :
Code:
lsattr /var/log/messages
Kind regards,

Eric
 
Old 01-10-2011, 03:59 AM   #11
hks1233
Member
 
Registered: Nov 2010
Posts: 30

Original Poster
Rep: Reputation: 1
Hi
Please have a look

Quote:
[root@xxx log]# ls -l /var | grep log
drwxr-xr-x 2 root root 4096 Nov 12 00:00 backuplog
drwxr-xr-x 15 root root 4096 Jan 10 10:12 log
[root@xxx log]# chattr -i /var/log/messages
[root@xxx log]# ls -l /var/log/messages
?r---ws--t 58243 115 59053 1358438049 Jan 10 10:55 /var/log/messages
[root@xxx log]# chown root.root messages
chown: changing ownership of `messages': Operation not permitted
[root@xxx log]# lsattr /var/log/messages
lsattr: Inappropriate ioctl for device While reading flags on /var/log/messages

Last edited by hks1233; 01-10-2011 at 04:02 AM.
 
Old 01-10-2011, 04:03 AM   #12
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Quote:
Originally Posted by hks1233 View Post
[root@xxx log]# chown root.root messages
chown: changing ownership of `messages': Operation not permitted
The command you are executing is wrong.
It should be,

Code:
# chown root:root /var/log/messages
not

Code:
chown root.root messages
 
Old 01-10-2011, 04:08 AM   #13
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

Try:
Code:
chattr -ais /var/log/messages
and try again. Also, do you have SELinux enabled?

Kind regards,

Eric
 
Old 01-10-2011, 04:12 AM   #14
hks1233
Member
 
Registered: Nov 2010
Posts: 30

Original Poster
Rep: Reputation: 1
Hi

Output
Quote:
[root@xxx log]# chattr -ais /var/log/messages
[root@xxx log]# chown root:root /var/log/messages
chown: changing ownership of `/var/log/messages': Operation not permitted
 
Old 01-10-2011, 04:26 AM   #15
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Quote:
Originally Posted by hks1233 View Post
Hi

Output
Hi, can you try these again and post the outputs?

Code:
#chattr -i /var/log/messeages
and then,

Code:
#echo $?
 
  


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
From where am i getting error messages to /var/log/messages? prabhuacsp Programming 3 02-16-2005 08:59 AM
From where am i getting error messages to /var/log/messages? prabhuacsp Linux - Networking 1 02-16-2005 12:34 AM
Error log in /var/log/messages raymond117 Linux - Security 9 01-26-2005 07:17 AM
Error /var/log/messages arthur_NGIT Linux - Software 0 05-26-2004 04:15 PM
Error in /var/log/messages pk21 Linux - General 4 10-25-2002 07:34 AM


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