diff --git a/libssh/src/auth.c b/libssh/src/auth.c index 9d099a53..5b8f748f 100644 --- a/libssh/src/auth.c +++ b/libssh/src/auth.c @@ -1109,7 +1109,7 @@ int ssh_userauth_publickey_auto(ssh_session session, #ifndef _WIN32 /* Try authentication with ssh-agent first */ rc = ssh_userauth_agent(session, username); - if (rc == SSH_AUTH_ERROR || rc == SSH_AUTH_SUCCESS) { + if (rc == SSH_AUTH_SUCCESS) { return rc; } if (rc == SSH_AUTH_AGAIN)