Best way to get machine id on Linux?

后端 未结 4 1243
一整个雨季
一整个雨季 2020-12-08 05:04

What is the best-practiced way to get an unique machine ID in GNU/Linux for i386 architecture?

Are there any good ways except the mac

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 05:37

    Depending on your kernel, the DMI information may be available via sysfs. Try those:

    # cat /sys/class/dmi/id/board_serial
    xxxxxxxxxxxxxxx
    # cat /sys/class/dmi/id/product_uuid
    xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    

    or using a tool

    # dmidecode -s baseboard-serial-number
    ...
    # dmidecode -s system-uuid
    ...
    

提交回复
热议问题