Is it possible to generate a unique ID that wouldn't change over time unless there is hardware changes. The hardware must be generated with a c program.
That also would be great if it were robust to spoofing, like MAC address or hard disk serial number spoofing. But that is not an absolute requirement.
I need such an ID in order to collect software datas for statistics from lot of different computers.
I've already read a lot of similar posts, like this one : generate consistent machine unique ID; but they don't suit my needs.
I need this program to run as normal user, so I can't use command like "dmidecode" and such. Even if I have no other solutions than to use MAC addresses, I don't want the UUID to change if the user switch from Wifi to ethernet, so just take the first mac address can be problematic. On top of that the UUID has to remain identical even if they install a VMware or VPN. So taking all the mac addresses is neither an option because those previous tools generate more network interfaces and so more mac addresses, thus changing the UUID.
I also want it to work on virtual machine, the guest uuid generated should be different than the host one.
I don't even know if there is such a solution for this problem. But what I thought would be to only take the mac addresses of all physical existing hardware interface by reading in sys/class/net/*/addresses. Then appending all mac addresses and hashing them with sha1 to generate the UUID. But how can I filter the repertories to only select inchanging one. And can I be sure that their ordrer won't be swapped, thus changing the appended string and so the UUID.
Otherwise, can I retrieve the hard disk serial number without root privilegies and third party tools? (If I can find the source for third party software it's okay)
Any other solutions would also be very welcome.
PS : It has to be compatible with any linux versions with kernel 2.6 or higher