Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit bf7c4dd

Browse files
authored
add ssh_banner_path variable (#316)
Signed-off-by: Volodymyr Litvak <[email protected]>
1 parent 75880c8 commit bf7c4dd

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Warning: This role disables root-login on the target server! Please make sure yo
5757
|`ssh_client_password_login` | false | `true` to allow password-based authentication with the ssh client |
5858
|`ssh_server_password_login` | false | `true` to allow password-based authentication with the ssh server |
5959
|`ssh_banner` | `false` | `true` to print a banner on login |
60+
|`ssh_banner_path`| '/etc/sshd/banner.txt' | path to the SSH banner file |
6061
|`ssh_client_hardening` | `true` | `false` to stop harden the client |
6162
|`ssh_client_port` | `'22'` | Specifies the port number to connect on the remote host. |
6263
|`ssh_client_compression` | `false` | Specifies whether the client requests compression. |

defaults/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ ssh_print_motd: false # sshd
137137
# false to disable display of last login information
138138
ssh_print_last_log: false # sshd
139139

140-
# false to disable serving /etc/ssh/banner.txt before authentication is allowed
140+
# false to disable serving ssh warning banner before authentication is allowed
141141
ssh_banner: false # sshd
142142

143+
# path to file with ssh warning banner
144+
ssh_banner_path: '/etc/ssh/banner.txt'
145+
143146
# false to disable distribution version leakage during initial protocol handshake
144147
ssh_print_debian_banner: false # sshd (Debian OS family only)
145148

templates/opensshd.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ PrintMotd {{ 'yes' if (ssh_print_motd|bool) else 'no' }}
231231
PrintLastLog {{ 'yes' if (ssh_print_last_log|bool) else 'no' }}
232232
{% endif %}
233233

234-
Banner {{ '/etc/ssh/banner.txt' if (ssh_banner|bool) else 'none' }}
234+
Banner {{ ssh_banner_path if (ssh_banner|bool) else 'none' }}
235235

236236
{% if ansible_facts.os_family == 'Debian' %}
237237
DebianBanner {{ 'yes' if (ssh_print_debian_banner|bool) else 'no' }}

0 commit comments

Comments
 (0)