1

I got a question.

That is I want to retrieve a system uuid to generate an identity. But I found that root privilege is needed if I execute command cat /sys/devices/virtual/dmi/id/product_uuid.Just same as dmidecode -s system-uuid,Someone tell me that I can install lshal. But I don't want to install it. Because code will not work if others computer didn't install lshal. So I want to get product_uuid without root privilege.

OnlyThen
  • 31
  • 2
  • 1
    `retrieve a system uuid` ? There is no such thing as "system uuid' - usually such thing is _generated_ from other things, like network interface mac address. `cat /sys/devices/virtual/dmi/id/product_name` that file for me just has motherboard name, bad choose for "system uuid". `Someone tell me that I can install lshal` ? Sure why not, i'll tell you. "You can install lshal". – KamilCuk Jul 29 '20 at 07:26
  • 1
    What is your actual question? – kaylum Jul 29 '20 at 07:30
  • Sorry, I just edited my question, which I mean is `product_uuid` instead of `product_name`. – OnlyThen Jul 29 '20 at 07:32
  • I have added an answer to https://stackoverflow.com/a/63148464/9072753 , cause I _guess_ that you got your information from there. Does it answer your question? – KamilCuk Jul 29 '20 at 07:33
  • I know that. But the result of `cat /etc/machine-id` is different from `sudo cat /sys/devices/virtual/dmi/id/product_uuid` – OnlyThen Jul 29 '20 at 07:39
  • ? Why does it matter? – KamilCuk Jul 29 '20 at 08:01
  • @OnlyThen: As an user, I do not want programs to have free access to immutable identifiable information they can use to fingerprint *me*. Systemd uses `/var/lib/dbus/machine-id` for exactly this purpose, and I actually dislike that too – but at least I can change it if I want to. So, the true question is, *what do you need an immutable machine identifier for*? If the answer includes *"licensing"*, use a licensing server with certificates, instead of playing willy-nilly with immutable user-identifying information. – None Jul 29 '20 at 19:29
  • Yeah, You are right. But I just want to do a C implementation of this [Project](https://github.com/sebhildebrandt/systeminformation/blob/master/lib/system.js). In it's system.js. They use `product_uuid`, And I want to implement it by my self. Just all. – OnlyThen Jul 30 '20 at 03:18

0 Answers0