File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
roles/ssh_hardening/templates Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -274,18 +274,6 @@ RevokedKeys /etc/ssh/revoked_keys
274274# Subsystem sftp /opt/app/openssh5/libexec/sftp-server
275275
276276Subsystem sftp internal-sftp -l INFO -f LOCAL6 -u {{ sftp_umask }}
277-
278- # These lines must appear at the *end* of sshd_config
279- Match Group sftponly
280- ForceCommand internal-sftp -l INFO -f LOCAL6 -u {{ sftp_umask }}
281- {% if sftp_chroot %}
282- ChrootDirectory {{ sftp_chroot_dir }}
283- {% endif %}
284- AllowTcpForwarding no
285- AllowAgentForwarding no
286- PasswordAuthentication {{ 'yes' if (ssh_server_password_login|bool) else 'no' }}
287- PermitRootLogin no
288- X11Forwarding no
289277{% endif %}
290278{% if ssh_server_match_address %}
291279
@@ -335,3 +323,17 @@ Match LocalPort {{ item.port }}
335323 {% endfor %}
336324{% endfor %}
337325{% endif %}
326+
327+ {% if sftp_enabled %}
328+ # These lines must appear at the *end* of sshd_config
329+ Match Group sftponly
330+ ForceCommand internal-sftp -l INFO -f LOCAL6 -u {{ sftp_umask }}
331+ {% if sftp_chroot %}
332+ ChrootDirectory {{ sftp_chroot_dir }}
333+ {% endif %}
334+ AllowTcpForwarding no
335+ AllowAgentForwarding no
336+ PasswordAuthentication {{ 'yes' if (ssh_server_password_login|bool) else 'no' }}
337+ PermitRootLogin no
338+ X11Forwarding no
339+ {% endif %}
You can’t perform that action at this time.
0 commit comments