2025-03-14 21:59:59 -06:00
|
|
|
# systemd-machine-id-setup
|
|
|
|
|
|
|
|
|
|
> Initialize the machine ID stored in `/etc/machine-id` at install time with a provisioned or randomly generated ID.
|
|
|
|
|
> Note: Always use `sudo` to execute these commands as they require elevated privileges.
|
|
|
|
|
> More information: <https://www.freedesktop.org/software/systemd/man/systemd-machine-id-setup.html>.
|
|
|
|
|
|
|
|
|
|
- Print the generated or committed machine ID:
|
|
|
|
|
|
|
|
|
|
`systemd-machine-id-setup --print`
|
|
|
|
|
|
|
|
|
|
- Specify an image policy:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`systemd-machine-id-setup --image-policy {{your_policy}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Display the output as JSON:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`sudo systemd-machine-id-setup --json pretty`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Operate on a disk image instead of a directory tree:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`systemd-machine-id-setup --image {{/path/to/image}}`
|