Search code examples
c++linuxwxwidgetsuniqueidentifier

Linux Equivalent of MachineGuid


I have program that needs OS installation fingerprint like one in MSW stored at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid In Microsoft Windows I have it ready for me but I cannot find equivalent for Linux. Is there anything close to this in Linux? I will not have root access so anything like dmidecode -s system-uuid becomes out of the question.

An example will be nice but no necessary.


Solution

  • One possibility would be to read /etc/ssh/ssh_host_{d,r}sa_key.pub, which are readable by all, and are randomly generated during installation.

    Obviously the problem is that those files may not exist at all, if there is no SSH (server) installed. They are also often copied from an older installation.