Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit 686972f

Browse files
committed
add version check for AuthenticationMethods
Signed-off-by: szEvEz <szivos.john@gmail.com>
1 parent bea269a commit 686972f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/opensshd.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ UsePAM {{ 'yes' if (ssh_use_pam|bool) else 'no' }}
109109
{% endif %}
110110

111111
# Set AuthenticationMethods per default to publickey
112+
# AuthenticationMethods was introduced in OpenSSH 6.2 - https://www.openssh.com/txt/release-6.2
113+
{% if sshd_version.stdout is version('6.2', '>=') %}
112114
AuthenticationMethods {{ sshd_authenticationmethods }}
115+
{% endif %}
113116

114117
# Disable password-based authentication, it can allow for potentially easier brute-force attacks.
115118
PasswordAuthentication {{ 'yes' if (ssh_server_password_login|bool) else 'no' }}

0 commit comments

Comments
 (0)