Skip to content

Commit ccb5303

Browse files
committed
fix sshd failing to start on noble (OpenSSH 9.x)
Gate deprecated directives (Protocol, UseLogin, UsePrivilegeSeparation, RhostsRSAAuthentication) behind OS version check. These were removed in OpenSSH 7.4-7.6 and cause sshd to refuse to start on Ubuntu Noble.
1 parent c61d369 commit ccb5303

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

salt/ssh/configs/sshd_config.jinja

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ HostKey /etc/ssh/ssh_host_rsa_key
3232
# ======================
3333

3434
# Set the protocol version to 2 for security reasons. Disables legacy support.
35+
# Removed in OpenSSH 7.6+ (protocol 1 no longer supported)
36+
{% if grains["oscodename"] not in ["jammy", "noble"] %}
3537
Protocol 2
38+
{% endif %}
3639

3740
# Make sure sshd checks file modes and ownership before accepting logins. This
3841
# prevents accidental misconfiguration.
@@ -67,8 +70,11 @@ KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,
6770
# --------------
6871

6972
# Secure Login directives.
73+
# UseLogin and UsePrivilegeSeparation removed in OpenSSH 7.4+/7.5+
74+
{% if grains["oscodename"] not in ["jammy", "noble"] %}
7075
UseLogin no
7176
UsePrivilegeSeparation yes
77+
{% endif %}
7278
PermitUserEnvironment no
7379
LoginGraceTime 30s
7480
MaxAuthTries 2
@@ -82,7 +88,10 @@ PubkeyAuthentication yes
8288
IgnoreRhosts yes
8389
IgnoreUserKnownHosts yes
8490
HostbasedAuthentication no
91+
# RhostsRSAAuthentication removed in OpenSSH 7.4+
92+
{% if grains["oscodename"] not in ["jammy", "noble"] %}
8593
RhostsRSAAuthentication no
94+
{% endif %}
8695

8796
# Enable PAM to enforce system wide rules
8897
UsePam {% if salt["pillar.get"]("ssh:use_pam", True) %}yes{% else %}no{% endif %}

0 commit comments

Comments
 (0)