- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- run /usr/sbin/dmesg with a limited user account - ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 03:04 AM
07-14-2008 03:04 AM
run /usr/sbin/dmesg with a limited user account - no root
I have an HP-UX box, and i need to run the dmesg command located in /usr/sbin. This command should be run using a limited user, permissions are given to everyone on that command, but it seems it goes to read from the kernel. could anyone help, how to make it possible to run this command with a specific user without giving him hight privileges ?
here is the output:
==============================
bash$ /usr/sbin/dmesg
Jul 14 14:04
Can't read kernel memory
==============================
Thanks guys
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 03:19 AM
07-14-2008 03:19 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 03:52 AM
07-14-2008 03:52 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
What information are you *rally* trying to discern from 'dmesg'?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 04:39 AM
07-14-2008 04:39 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
it is my system, it is a monitoring system, and it runs this command to get information related to the memory capacity and memory utilization.
file permissions or dmesg allows all users to run the file:
$ ls -l /usr/sbin/dmesg
lrwxr-xr-x 1 root sys 11 Feb 13 2002 dmesg -> /sbin/dmesg
$ ls -l /sbin/dmesg
-r-xr-xr-x 1 bin bin 212992 Nov 14 2000 /sbin/dmesg
So the rights are given to everybody to run the file, but it seems a part of this command tries to read the kernel which is not allowed to my user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 04:44 AM
07-14-2008 04:44 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
You can use crontab to schedule dmesg entries to be written into separate file - http://docs.hp.com/en/B3921-90010/dmesg.1M.html
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 04:46 AM
07-14-2008 04:46 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
I suspected that is was memory information that you wanted. Why, is still unclear, but:
# echo "selclass qualifier memory;info;wait;infolog"|cstm > /var/tmp/meminfo
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 05:02 AM
07-14-2008 05:02 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
but I really need the user to run that specific command as I cannot change in the source code of the monitoring system to use the other command.
besides, it still needs to calculate percentage of utilizewd memory.
I need to let a user run /usr/sbin/dmesg
Thanks guys
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 05:14 AM
07-14-2008 05:14 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
Be aware that dmesg will NOT have this info if the system has been up for some time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 05:20 AM
07-14-2008 05:20 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
dmesg is a circular buffer of messages. Once the buffer is full, older messages will disappear as newer messages are received.
So, eventually you will NOT be able to find your memory info is the dmesg buffer.
You really need to look for an alternate means to get the information you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 05:23 AM
07-14-2008 05:23 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 10:37 PM
07-14-2008 10:37 PM
Re: run /usr/sbin/dmesg with a limited user account - no root
if anyone can help me with what is needed for this user to run dmesg, that would be great
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 10:40 PM
07-14-2008 10:40 PM
Re: run /usr/sbin/dmesg with a limited user account - no root
I consulted the company that created this system, they told me that the user must be able to run dmesg successfully. this is why I need it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 10:50 PM
07-14-2008 10:50 PM
Re: run /usr/sbin/dmesg with a limited user account - no root
No idea what your application does and information it pulls from dmesg.
Since /usr/sbin/dmesg is only a link to /sbin/dmesg, you may consider to replace this link by a sudo script - this is up to you.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 11:43 PM
07-14-2008 11:43 PM
Re: run /usr/sbin/dmesg with a limited user account - no root
I am trying to find a workaround as we cannot use root for such thing.
as seen above, all users have permissions to run the link and the original file or script.
but as I could see from the error, it cannot read for the kernel.
All I am looking for is a way to let this non-root (limited user) run the dmesg successfully.
Any workaround or hint is highly appreciated.
Is there a way to let my user run it? is there a specific permission to be given? or change in the link properties?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2008 02:41 AM
07-15-2008 02:41 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
As you said, the permissions are a joke, only root can run it successfully.
>I am looking for is a way to let this non-root (limited user) run the dmesg successfully.
If you don't care that ANY user can run dmesg, you can do the obvious and make /sbin/dmesg SUID root:
# chown root /sbin/dmesg
# chmod u+s /sbin/dmesg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2008 03:01 AM
07-15-2008 03:01 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
yeah, maybe we can do that but for a specific group instead and make the user a part of that group, no?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2008 03:40 AM
07-15-2008 03:40 AM
Re: run /usr/sbin/dmesg with a limited user account - no root
You might want to remove "x" for other and chgrp to you new group. (I'm not sure which take precedence, SUID root or execute permission.)