How to get dmidecode information without root privileges?
22
votes
10
answers
62353
views
I'm writing a program that displays various system information (on a CentOS system). For example, the processor type and speed (from
/proc/cpuinfo
), the last boot time (calculated from /proc/uptime
), the IP address (from ifconfig
output), and a list of installed printers (from lpstat
output).
Currently, several pieces of data are obtained from the dmidecode
program:
* The platform type (dmidecode -s system-product-name
)
* The BIOS version (dmidecode -s bios-version
)
* The amount of physical memory (dmidecode -t17 | grep Size
)
These are only available if my program is run as root (because otherwise the dmidecode
subprocess fails with a /dev/mem: Permission denied
error). Is there an alternative way to get this information, that a normal user can access?
Asked by user1024
(593 rep)
Nov 8, 2011, 05:29 PM
Last activity: Oct 26, 2023, 06:25 AM
Last activity: Oct 26, 2023, 06:25 AM