feat: use SSH host certificates (#3786)

This commit is contained in:
miampf 2025-07-01 12:47:04 +02:00 committed by GitHub
parent 95f17a6d06
commit 7ea5c41f9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 706 additions and 117 deletions

View file

@ -74,7 +74,12 @@ func writeCertificateForKey(cmd *cobra.Command, keyPath string, fh file.Handler,
return fmt.Errorf("generating SSH emergency CA key: %s", err)
}
debugLogger.Debug("SSH CA KEY generated", "public-key", string(ssh.MarshalAuthorizedKey(ca.PublicKey())))
marshalledKey := string(ssh.MarshalAuthorizedKey(ca.PublicKey()))
debugLogger.Debug("SSH CA KEY generated", "public-key", marshalledKey)
knownHostsContent := fmt.Sprintf("@cert-authority * %s", marshalledKey)
if err := fh.Write("./known_hosts", []byte(knownHostsContent), file.OptMkdirAll); err != nil {
return fmt.Errorf("writing known hosts file: %w", err)
}
keyBuffer, err := fh.Read(keyPath)
if err != nil {