Using a non-root account for dmidecode
By default, the dmidecode command can only be run on Unix systems using the root user account.
Using a standard user account will display the following error
/dev/mem: Permission denied
To allow a non-root account to execute the dmidecode application the following steps must be completed.
- Select an existing account, or create a new dedicated user account on the Unix systems.
- Open the sudoers configuration file - typically /etc/sudoers.
- Add the following settings to the sudoers file
User_Alias XIACONFIGURATION = username
Cmnd_Alias DMIDECODE = /usr/sbin/dmidecode
XIACONFIGURATION ALL = NOPASSWD: DMIDECODE
The non-root user should now be able to execute the dmidecode command without being prompted for a password.