Using
dmidecode -s system-uuid
I get back:
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: Permission denied
With sudo and the admin password, no problem.
I want to use the UUID in a python script to identify the local machine on the webserver's database, but this local script should not run with admin permissions and I do not want to hard-code credentials. What can I do?
Is there a pure python way, similar to
machineId = os.popen("cat /etc/machine-id").read() ?
Extended questions
The output of
dmidecode -s system-uuidhas the same value as/sys/devices/virtual/dmi/id/product_uuidwhich is a file with 400 permission. I changed it for testing purposes to 444 and now I can read it without admin rights. Can this be a risk? If not, problem solved.Are product-uuid AND system-uuid the same, only named differently? How is it calculated? On every boot again? Will this value stored in
/sys/devices/virtual/dmi/id/product_uuidbe changed and overwritten, if the entire disk is a dd clone and running on a new/different mainboard?
The reason not to use machine-id is, that as far as I know, the machine-id is not changed / overwritten when the entire system is cloned via dd and used on another mainboard. I am developing a multipoint point of sale system with a bunch of the same computers with the same disk images, for service simplification. But each of them must be / is registered in the customer's dashboard and is assigned to different tasks.