diff --git a/providers/os/id/sshhostkey/sshhostkey.go b/providers/os/id/sshhostkey/sshhostkey.go index 1e8e3aec1f..b0ae426434 100644 --- a/providers/os/id/sshhostkey/sshhostkey.go +++ b/providers/os/id/sshhostkey/sshhostkey.go @@ -36,6 +36,8 @@ func Detect(t shared.Connection, p *inventory.Platform) ([]string, error) { if os.IsPermission(err) { log.Warn().Err(err).Str("hostkey", hostKeyFilePath).Msg("no permission to access ssh hostkey") continue + } else if os.IsNotExist(err) { + continue } else if err != nil { return nil, errors.Wrap(err, "could not read file:"+hostKeyFilePath) }