Skip to content

Commit

Permalink
Reset SSH CAs and authorized keys on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmaguire committed Mar 26, 2024
1 parent bb009ab commit 2854858
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ func configSSH(l *logrus.Logger, ssh *sshd.SSHServer, c *config.C) (func(), erro
return nil, fmt.Errorf("error while adding sshd.host_key: %s", err)
}

// Clear existing trusted CAs and authorized keys
ssh.ClearTrustedCAs()
ssh.ClearAuthorizedKeys()

rawCAs := c.GetStringSlice("sshd.trusted_cas", []string{})
for _, caAuthorizedKey := range rawCAs {
err := ssh.AddTrustedCA(caAuthorizedKey)
Expand Down

0 comments on commit 2854858

Please sign in to comment.