move Match Group sftponly block to the end
Signed-off-by: Michael <[email protected]>
This commit is contained in:
1 parent
0a52f9195a
commit
4ae5acf050
3 files changed
+14
-20
No files matched your search
@@ -89,11 +89,6 @@ For more information, see [this issue](https://github.com/dev-sec/ansible-collec
|
|||||||
- Description: Specifies the umask for sftp.
|
- Description: Specifies the umask for sftp.
|
||||||
- Type: str
|
- Type: str
|
||||||
- Required: no
|
- Required: no
|
||||||
- `sftp_password_login`
|
|
||||||
- Default: inherite from `ssh_server_password_login`
|
|
||||||
- Description: Set to `true` to allow password-based authentication to the sftp server. You probably also need to change `sshd_authenticationmethods` to include `password` if you set `sftp_password_login`: `true`.
|
|
||||||
- Type: bool
|
|
||||||
- Required: no
|
|
||||||
- `ssh_allow_agent_forwarding`
|
- `ssh_allow_agent_forwarding`
|
||||||
- Default: `False`
|
- Default: `False`
|
||||||
- Description: Set to `false` to disable Agent Forwarding. Set to `true` to allow Agent Forwarding.
|
- Description: Set to `false` to disable Agent Forwarding. Set to `true` to allow Agent Forwarding.
|
||||||
|
|||||||
@@ -180,9 +180,6 @@ sftp_umask: "0027"
|
|||||||
# change default sftp chroot location
|
# change default sftp chroot location
|
||||||
sftp_chroot_dir: /home/%u
|
sftp_chroot_dir: /home/%u
|
||||||
|
|
||||||
# If true, password login for sftp is allowed
|
|
||||||
sftp_password_login: "{{ ssh_server_password_login }}"
|
|
||||||
|
|
||||||
# enable experimental client roaming
|
# enable experimental client roaming
|
||||||
ssh_client_roaming: false
|
ssh_client_roaming: false
|
||||||
|
|
||||||
|
|||||||
@@ -274,18 +274,6 @@ RevokedKeys /etc/ssh/revoked_keys
|
|||||||
# Subsystem sftp /opt/app/openssh5/libexec/sftp-server
|
# Subsystem sftp /opt/app/openssh5/libexec/sftp-server
|
||||||
|
|
||||||
Subsystem sftp internal-sftp -l INFO -f LOCAL6 -u {{ sftp_umask }}
|
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 %}
|
{% endif %}
|
||||||
{% if ssh_server_match_address %}
|
{% if ssh_server_match_address %}
|
||||||
|
|
||||||
@@ -335,3 +323,17 @@ Match LocalPort {{ item.port }}
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% 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 %}
|
||||||
Reference in new issue
Block a user