When connecting to a host that expects key authentication, which key (if any) will be tried if there is no key found under the path ~/.ssh/id_rsa* when using ssh client from commandline in linux?


There are also tried keys provided by running ssh-agent (added by ssh-add) and the keys explicitly mentioned in configuration files as IdentityFile option.

If none of them applies, then the authentication using publickey fails and usually falls back to password authentication. If password authentication is not allowed (on server or on client), the whole authentication fails.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.