Skip to content

Commit

Permalink
allow seperate password login for sftp
Browse files Browse the repository at this point in the history
Signed-off-by: mib1185 <[email protected]>
  • Loading branch information
mib1185 committed Sep 19, 2024
1 parent d386d0f commit b3bdd13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions roles/ssh_hardening/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ For more information, see [this issue](https://github.com/dev-sec/ansible-collec
- Description: Specifies the umask for sftp.
- Type: str
- 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`
- Default: `false`
- Description: Set to `false` to disable Agent Forwarding. Set to `true` to allow Agent Forwarding.
Expand Down
3 changes: 3 additions & 0 deletions roles/ssh_hardening/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ sftp_umask: "0027"
# change default sftp chroot location
sftp_chroot_dir: /home/%u

# If true, password login for sftp is allowed
sftp_password_login: "{{ ssh_server_password_login }}"

# enable experimental client roaming
ssh_client_roaming: false

Expand Down
2 changes: 1 addition & 1 deletion roles/ssh_hardening/templates/opensshd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ Match Group sftponly
{% endif %}
AllowTcpForwarding no
AllowAgentForwarding no
PasswordAuthentication {{ 'yes' if (ssh_server_password_login|bool) else 'no' }}
PasswordAuthentication {{ 'yes' if (sftp_password_login|bool) else 'no' }}
PermitRootLogin no
X11Forwarding no
{% endif %}
Expand Down

0 comments on commit b3bdd13

Please sign in to comment.