Skip to content

Commit

Permalink
fix: [CODE-3036]: ssh startup issue (#3267)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav-harness authored and Harness committed Jan 15, 2025
1 parent b94a78c commit ab2a066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssh/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (s *Server) setupHostKeys() error {

if len(keys) == 0 {
log.Debug().Msg("no host key provided - setup default key if it doesn't exist yet")
err := createKeyIfNotExists(s.ServerKeyPath)
err := CreateKeyIfNotExists(s.ServerKeyPath)
if err != nil {
return fmt.Errorf("failed to setup default key %q: %w", s.ServerKeyPath, err)
}
Expand Down Expand Up @@ -370,7 +370,7 @@ func sshConnectionFailed(conn net.Conn, err error) {
log.Err(err).Msgf("failed connection from %s with error: %v", conn.RemoteAddr(), err)
}

func createKeyIfNotExists(path string) error {
func CreateKeyIfNotExists(path string) error {
_, err := os.Stat(path)
if err == nil {
// if the path already exists there's nothing we have to do
Expand Down

0 comments on commit ab2a066

Please sign in to comment.