feat(live): Set the root password from ISO metadata #1290
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Avoid using the well known default root password in the Live medium.
Solution
Allow modifying the default root password in the ISO medium by users. A new default root password can be embedded into the ISO file metadata using this command:
This will embed a SHA512 hashed password into the ISO application area. This area is already used for storing the medium checksum, if you run the
checkmedia
command to verify the medium integrity then the expected checksum is read from this metadata. You can check its content by runningtagmedia <agama.iso>
.The ISO application area is pretty small (512 bytes), but there is still enough space to embed a hashed root password. Unfortunately it needs to be Base64 encoded otherwise
tagmedia
then reports an error about unsupported format.If the root password is set by other options on the boot command line (see #1288) then they will override this ISO file default.
The advantage of this solution is that it does not need any special tweaks and you do not root permissions to modify the ISO image. This solution is suitable for mass deployment using the same physical medium. You can modify the ISO, dump it on an USB stick and then install several machines using your specific root password.
Testing
TODO
Later: