gpt4 book ai didi

java - Linux系统调用获取机器序列号

转载 作者:IT王子 更新时间:2023-10-29 01:19:29 30 4
gpt4 key购买 nike

我知道这是不可能的,但是有没有办法在 Linux 上获取序列号或唯一标识信息?

如果是这样,如何将其编程为 Java 程序?

在上下文中,我需要构建一个锁定到一台机器的许可证 validator 。如果您有任何其他建议,欢迎提出。

最佳答案

这是 blog post 的摘录Lennart Poettering 关于一般 ID 的文章。它是关于唯一 ID,不一定是与安全相关的唯一 ID:

  • /sys/class/dmi/id/product_uuid: The main board product UUID, as set by theboard manufacturer and encoded in theBIOS DMI information. It may be usedto identify a mainboard and only themainboard. It changes when the userreplaces the main board. Also, oftenenough BIOS manufacturers write bogusserials into it. In addition, it isx86-specific. Access for unprivilegedusers is forbidden. Hence it is oflittle general use.

  • CPUID/EAX=3 CPU serial number: A CPU UUID, as set by the CPU manufacturerand encoded on the CPU chip. It may beused to identify a CPU and only a CPU.It changes when the user replaces theCPU. Also, most modern CPUs don'timplement this feature anymore, andolder computers tend to disable thisoption by default, controllable via aBIOS Setup option. In addition, it isx86-specific. Hence this too is oflittle general use.

所以 /sys/class/dmi/id/product_uuid 似乎是您的验证守护程序的一个很好的候选者,但这意味着您的验证代码需要作为特权用户运行。完整的博文非常值得一读!

关于java - Linux系统调用获取机器序列号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3421642/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com