diff --git a/internal/backend/crypto/age/ssh.go b/internal/backend/crypto/age/ssh.go index 85af37bec7..d256ae068b 100644 --- a/internal/backend/crypto/age/ssh.go +++ b/internal/backend/crypto/age/ssh.go @@ -69,7 +69,7 @@ func (a *Age) getSSHIdentities(ctx context.Context) (map[string]age.Identity, er func getSSHDir() (string, error) { preferredPath := os.Getenv("GOPASS_SSH_DIR") sshDir := filepath.Join(preferredPath, ".ssh") - if fsutil.IsDir(sshDir) { + if preferredPath != "" && fsutil.IsDir(sshDir) { return preferredPath, nil }