How to change the number of password attempts for ssh from default 3 attempt in Red Hat Entperprise Linux?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9

Issue

  • When user tries to log in via ssh, ssh closes connection after three failed attempts. We want to increase the number of authentication attempts ( password prompt ).

Resolution

  • On the Red Hat Enterprise Linux ssh-client system, modify or declare the NumberOfPasswordAttempts option in the /etc/ssh/ssh_config file as per requirement. The default number is 3 times.
    For setting log in attempts to five times, the option would be declared as below :
NumberOfPasswordAttempts 5

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments