0

When I connect to a remote machine using ssh, my ssh agent will try all key files available in .ssh.

Per default, how many key files can the agent try for the log-in until server sends permission denied (publickey)?

3

From man sshd_config:

MaxAuthTries

Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. The default is 6.

My memory is that this has been consistent for many releases of OpenSSH, but as with any configurable, it is best to run man on your own system (the remote system in this case) to check the manual pages for the actual installation on that system.

  • I was only searching in the config file, seems this value is not set per default. Many thanks, exactly what I was looking for! – kerner1000 Jan 18 '18 at 13:19
  • Maybe important to mention: If I understand correctly, that means after 3 failures I will get permission denied (Once the number of failures reaches half this value). – kerner1000 Jan 18 '18 at 13:24
  • 1
    @kerner1000, you should get permission denied after 6 failures. You should see log messages for authentication failures between 3-5. Failures less than 2 should be silently ignored. – user4556274 Jan 18 '18 at 15:20

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.