Skip to content

Commit

Permalink
Add a variable for destination of the verbose SFTP log
Browse files Browse the repository at this point in the history
Closes #2
  • Loading branch information
strebitz committed Sep 18, 2020
1 parent 3bb0915 commit 9fa833e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ The following role variables are relevant:
* `sftp_start_directory`: A directory that need to be part of sftp\_directories values and that is the start directory of new sftp connection. Disable by default with an empty string value.
* `sftp_allow_passwords`: Whether or not to allow password authentication for SFTP. Defaults to False.
* `sftp_enable_selinux_support`: Whether or not to explicitly enable SELinux support. Defaults to False.
* `sftp_enable_logging`: Enable logging. Auth logs will be written to `/var/log/sftp/auth.log`, and SFTP activity logs will be written to `/var/log/sftp/verbose.log`. Defaults to False.
* `sftp_enable_logging`: Enable logging; defaults to `False`.
* `sftp_logging_destination`: Rsyslogd destination for SFTP activity logs; defaults to `-/var/log/sftp/verbose.log`.
* `sftp_users`: A list of users, in map form, containing the following elements:
* `name`: The Unix name of the user that requires SFTP access.
* `group`: An optional user primary group. If set, it will be used for the user's home permission. Otherwise, the `sftp_group_name` is used.
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ sftp_allow_passwords: False
sftp_enable_selinux_support: False
sftp_enable_logging: False
sftp_nologin_shell: /sbin/nologin
sftp_logging_destination: -/var/log/sftp/verbose.log
sftp_configure_sshd: true
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
{% endfor %}
# Log internal-sftp in a separate file
:programname, isequal, "internal-sftp" -/var/log/sftp/verbose.log
:programname, isequal, "internal-sftp" {{ sftp_logging_destination }}
:programname, isequal, "internal-sftp" ~
when: sftp_enable_logging
notify: SFTP-Server | Restart rsyslog
Expand Down

0 comments on commit 9fa833e

Please sign in to comment.