0

At Python program I use uuid.uuid1().node for binding to hardware configuration (MAC-address). Under Windows 10 everything works well, uuid.uuid1().node every time is the same and it's equal to MAC-address, but under Ubuntu 20.04 after every reboot new number is generated and it differs from MAC.

Is it possible to get MAC-address under Ubuntu or bind hardware somehow else?

pupinho
  • 13
  • 3
  • Some Linux distros override the MAC on boot by default as a privacy feature. If it is indeed happening, how to turn that feature off is distro-specific and not on topic here. – Charles Duffy Jan 24 '22 at 19:04
  • If you want the MAC address of your net card, you should use the network APIs and not rely on hackery like this. – Tim Roberts Jan 24 '22 at 19:08
  • I'd consider using `ip link list` to see if it's happening, and ask a new question at [ubuntu.se] if it is. – Charles Duffy Jan 24 '22 at 19:09
  • As for "bind hardware somehow else" -- could you be more specific about what you mean to accomplish? – Charles Duffy Jan 24 '22 at 19:11
  • Also, keep in mind that as this demonstrates, MAC addresses can be overridden from software. If you're trying to do something like copy protection, it's not a strong approach; really, to find something that _is_ a strong approach you'll find yourself in the world of dongles. – Charles Duffy Jan 24 '22 at 19:13
  • (A user can also modify their MAC address with a lot of network cards on Windows; it's not Linux-specific functionality). – Charles Duffy Jan 24 '22 at 19:17
  • `ip a` shows actual MAC every time, but `uuid.uuid1().node` is diffenent after every reboot, so I don't know what should I ask at 'Ask Ubuntu'? By 'binding' I mean getting an unique id from every customer to provide them with different options. – pupinho Jan 24 '22 at 19:31
  • This question has already discussed in topic https://stackoverflow.com/questions/159137/getting-mac-address. – pupinho Jan 24 '22 at 20:16

0 Answers0