How to get serial numbers?
No :) This is not a warez/crackz/serialz question :p.
I am searching how I can uniquely identify a computer. I want to use it in a program I'm making to see which computer is talking to me (once send a hash of those, and then I know who it is). What I was thinking of were the following items: - CPU type, speed + CPUID (if present). - Memory type, serials (if present) - Harddrive type + serials (if present). - Mainboard type + serials (if present). But does anyone know how to get those? At windows I can find out my cputype(--serial) + memory type(++serial) At linux I can find out my cputype(--serial) + harddrives Where could i start looking? Is there some program which implements those features already? Thanks a lot! |
Take a look at dmidecode. For example, as root:
dmidecode > dmi.txt |
If your requirement is to communicate these numbers using ethernet, then the ethernet MAC should, itself, be unique enough. For TCP/IP based communications, each host should be caching these in its own arp table. On a linux host, you can dump this table using the arp command.
Other than recent Intel CPUs having a CPU-ID, I don't think there is any standard way of uniquely identifying a host. The ethernet MAC was contrived to solve this problem, although there is no guarantee that any given host has one & only one such number, or even that they are absolutely unique (disreputable vendors have produced ethernet hardware with non-unique MACs). --- rod. |
Quote:
|
Quote:
|
Quote:
There's no sure way to identify a computer, and I don't think there should be. It's like implanting a chip into your head to identify you. Then somebody figures out how to cheat, and suddenly you've done something you didn't ;) |
Quote:
--- rod. |
Thank you for your answers so far! the dmidecode looks promising, although it doens't give me the same things as cpu-z under windows (like it cannot identify my memory). Maybe cpu-z is collecting magic numbers and then recognizing these to say which memory is what and stuff like that.
Oh, the environment is absolutely not hostile at all... It's just that I once send a huge batch from the client -> server with all kinds of data and then send a hash back, which uniquely defines that machine. In all later communications this hash is used (until some hardware components change). And that's exactly the issue ;-). I HAVE to know it when hardware changes. So basically that's a change of mobo, cpu, drives and memory. The rest is of less importance. Is there another tool than dmidecode which also provides me with similar information? (I checked out Todd Allen's cpuid & also browsed through the /proc dir), but maybe you guys (and mayhaps you girls) have another bright idea? :D Thanks! |
If you need to track also hardware modifications maybe you should have a look at how system profiles for the Red Hat Network are generated:
At first, following information is gathered from the system: Red Hat Linux version, Hostname, IP address, CPU model, CPU speed, Amount of RAM, PCI devices, Disk sizes. Then a hash value is calculated from that information to generate a unique serial. But maybe you can also use the ssh-host-keys that were generated during first boot of your system. |
All times are GMT -5. The time now is 07:26 AM. |