Skip to content

Commit 0a52f91

Browse files
committed
allow seperate password login for sftp
Signed-off-by: Michael <[email protected]>
1 parent e318aab commit 0a52f91

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

roles/ssh_hardening/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ For more information, see [this issue](https://github.com/dev-sec/ansible-collec
8989
- Description: Specifies the umask for sftp.
9090
- Type: str
9191
- Required: no
92+
- `sftp_password_login`
93+
- Default: inherite from `ssh_server_password_login`
94+
- 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`.
95+
- Type: bool
96+
- Required: no
9297
- `ssh_allow_agent_forwarding`
9398
- Default: `False`
9499
- Description: Set to `false` to disable Agent Forwarding. Set to `true` to allow Agent Forwarding.

roles/ssh_hardening/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ sftp_umask: "0027"
180180
# change default sftp chroot location
181181
sftp_chroot_dir: /home/%u
182182

183+
# If true, password login for sftp is allowed
184+
sftp_password_login: "{{ ssh_server_password_login }}"
185+
183186
# enable experimental client roaming
184187
ssh_client_roaming: false
185188

roles/ssh_hardening/templates/opensshd.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Match Group sftponly
283283
{% endif %}
284284
AllowTcpForwarding no
285285
AllowAgentForwarding no
286-
PasswordAuthentication {{ 'yes' if (ssh_server_password_login|bool) else 'no' }}
286+
PasswordAuthentication {{ 'yes' if (sftp_password_login|bool) else 'no' }}
287287
PermitRootLogin no
288288
X11Forwarding no
289289
{% endif %}

0 commit comments

Comments
 (0)