ssh: load more host key formats than rsa

This commit is contained in:
Mikaël Cluseau 2023-12-17 14:40:48 +01:00
parent 7f429a863d
commit c02f701c04
1 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,9 @@ func buildInitrd(out io.Writer, ctx *renderContext) (err error) {
// ssh keys
// FIXME we want a bootstrap-stage key instead of the real host key
cat.AppendBytes(cfg.FileContent("/etc/ssh/ssh_host_rsa_key"), "id_rsa", 0600)
for _, format := range []string{"rsa", "dsa", "ecdsa", "ed25519"} {
cat.AppendBytes(cfg.FileContent("/etc/ssh/ssh_host_"+format+"_key"), "id_"+format, 0600)
}
return cat.Close()
}