Skip to content

Commit d982a89

Browse files
authored
Merge pull request #598 from dennisse/master
OpenBSD does not support GSSAPI Authentication
2 parents e32d550 + 681898b commit d982a89

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

roles/ssh_hardening/templates/openssh.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ RSAAuthentication yes
106106
# Disable password-based authentication, it can allow for potentially easier brute-force attacks.
107107
PasswordAuthentication {{ 'yes' if ssh_client_password_login else 'no' }}
108108

109+
{# OpenBSD does not support GSSAPIAuthentication, so leave this out if on OpenBSD #}
110+
{% if ansible_facts.os_family != 'OpenBSD' %}
109111
# Only use GSSAPIAuthentication if implemented on the network.
110112
GSSAPIAuthentication {{ 'yes' if (ssh_gssapi_support|bool) else 'no' }}
111113
GSSAPIDelegateCredentials {{ 'yes' if (ssh_gssapi_delegation|bool) else 'no' }}
112114

115+
{% endif %}
113116
# Disable tunneling
114117
Tunnel no
115118

roles/ssh_hardening/templates/opensshd.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,13 @@ KerberosTicketCleanup yes
143143
#KerberosGetAFSToken no
144144
{% endif %}
145145

146+
{# OpenBSD does not support GSSAPIAuthentication, so leave this out if on OpenBSD #}
147+
{% if ansible_facts.os_family != 'OpenBSD' -%}
146148
# Only enable GSSAPI authentication if it is configured.
147149
GSSAPIAuthentication {{ 'yes' if ssh_gssapi_support else 'no' }}
148150
GSSAPICleanupCredentials yes
149151

152+
{% endif %}
150153
{% if ssh_deny_users %}
151154
# In case you don't use PAM (`UsePAM no`), you can alternatively restrict users and groups here.
152155
# For key-based authentication this is not necessary, since all keys must be explicitely enabled.

0 commit comments

Comments
 (0)