move Match Group sftponly block to the end

Signed-off-by: Michael <[email protected]>
This commit is contained in:
Michael committed 2025-02-25 15:29:00 +00:00
1 parent 0a52f9195a
commit 4ae5acf050
3 files changed
+14 -20

No files matched your search

+14 -12
View File
@@ -274,18 +274,6 @@ RevokedKeys /etc/ssh/revoked_keys
# Subsystem sftp /opt/app/openssh5/libexec/sftp-server
Subsystem sftp internal-sftp -l INFO -f LOCAL6 -u {{ sftp_umask }}
# These lines must appear at the *end* of sshd_config
Match Group sftponly
ForceCommand internal-sftp -l INFO -f LOCAL6 -u {{ sftp_umask }}
{% if sftp_chroot %}
ChrootDirectory {{ sftp_chroot_dir }}
{% endif %}
AllowTcpForwarding no
AllowAgentForwarding no
PasswordAuthentication {{ 'yes' if (sftp_password_login|bool) else 'no' }}
PermitRootLogin no
X11Forwarding no
{% endif %}
{% if ssh_server_match_address %}
@@ -335,3 +323,17 @@ Match LocalPort {{ item.port }}
{% endfor %}
{% endfor %}
{% endif %}
{% if sftp_enabled %}
# These lines must appear at the *end* of sshd_config
Match Group sftponly
ForceCommand internal-sftp -l INFO -f LOCAL6 -u {{ sftp_umask }}
{% if sftp_chroot %}
ChrootDirectory {{ sftp_chroot_dir }}
{% endif %}
AllowTcpForwarding no
AllowAgentForwarding no
PasswordAuthentication {{ 'yes' if (ssh_server_password_login|bool) else 'no' }}
PermitRootLogin no
X11Forwarding no
{% endif %}