/etc/machine-id

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

The /etc/machine-id file contains the unique machine ID of the local system that is set during installation. The machine ID is a single newline-terminated, hexadecimal, 32-character, lowercase ID. The machine ID is usually generated from a random source during system installation and stays constant for all subsequent boots. This ID uniquely identifies the host. It should be considered "confidential", and must not be exposed in untrusted environments, in particular on the network. If a stable unique identifier that is tied to the machine is needed for some application, the machine ID or any part of it must not be used directly. Instead the machine ID should be hashed with a cryptographic, keyed hash function, using a fixed, application-specific key.

Setting a New Machine ID

rm /etc/machine-id
systemd-machine-id-setup