LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-05-2008, 11:31 PM   #1
xthx1138@fastmail.fm
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
Can't Read /proc/kmsg Unless I'm root


Here's my problem:

mmiller@xpc1:~$ ls -l /proc/kmsg
-r-----r-- 1 root root 0 2008-01-06 04:27 /proc/kmsg
mmiller@xpc1:~$ cat /proc/kmsg
cat: /proc/kmsg: Operation not permitted

So, how come I can't read from /proc/kmsg, even though the permissions are open?
 
Old 01-06-2008, 05:31 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Why do you read /proc/kmsg as non-system user?
What are you trying to accomplish?
Isn't 'dmesg' output good enough?
 
Old 01-07-2008, 06:40 AM   #3
xthx1138@fastmail.fm
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Original Poster
Rep: Reputation: 0
For increased security I want to run my system log daemon as an unprivileged user. I also want to run it from a chroot jail. I'm actually mounting /proc/kmsg inside my chroot environment, and I'm setting all the permissions on that so that the logging user can access it, but the logger is not able to read from it. The example I started this post with is simplified, but I think it clearly shows what I believe is the underlying problem.

In particular, I want to run syslog-ng from a chroot as an unprivileged user. This is all working, except that I can't get at kernel messages. When I posted this problem to the syslog-ng forum I was told that I may have to tweak my SELinux settings, but I think that SELinux is not active on my system. I'm using Debian, and SELinux should be inactive by default.

As far as using dmesg, I don't know how to tell syslog-ng to read from this instead of trying to read from /proc/kmsg like it wants to.
 
Old 01-07-2008, 08:17 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
There's a lot of daemons that could be targets for chrooting and usually it involves those with a flakey security track record or those with otherwise doubtful survivability in hostile environments. One of the rules of building a chroot states you shouldn't mount /proc stuff in the chroot so that's a wee bit of a chicken and egg situation. If you don't mind me saying I think deploying SELinux is preferable to chrooting Syslogd but the attached learning curve might be prohibitive.

Only alternative I can think of is running Syslogd from init and logging to an unused IP address and having your remote IP-less syslog server, preferably not running anything else and properly hardened, picking it up.
 
  


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
problem with /proc/self/mem ... can i read it? eskuai Linux - Kernel 0 08-11-2006 07:14 AM
read /proc/net/dev with sscanf? Thinking Linux - General 0 03-30-2005 09:14 AM
How to read from /proc entry in another kernel module? linux_lover2005 Programming 0 01-14-2005 05:44 AM
kernel panic unable to mount root (yes ive read/read other posts) dmx9595 Linux - General 4 01-17-2004 05:07 AM
Nautilus will not read /proc directory RottenMutt Linux - General 1 07-10-2003 01:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:31 AM.

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