在Linux上获取机器ID的最佳方法? [英] Best way to get machine id on Linux?

查看:1715
本文介绍了在Linux上获取机器ID的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于i386架构,在GNU/Linux中获取唯一机器ID的最佳实践是什么?

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

除了mac地址之外,还有什么好方法吗?

Are there any good ways except the mac address?

推荐答案

取决于您的内核,可以通过sysfs获得DMI信息. 尝试那些:

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

或使用工具

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

这篇关于在Linux上获取机器ID的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆