Best way to get machine id on Linux?

后端 未结 4 1244
一整个雨季
一整个雨季 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:22

    You can use lshal. This needs hal (apt-get install hal or yum install hal) to be installed first. This way you can access all the info of dmidecode without root permissions.

    A non-root equivalent of

    # dmidecode | grep -i uuid
    

    will be

    $ lshal |grep -i system.hardware.uuid
    

    And similarly other info as per your needs.

提交回复
热议问题