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

Commit 5e95d93

Browse files
author
Sebastian Gumprich
committed
fix multiple match rules not working
1 parent a69a3ca commit 5e95d93

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

templates/opensshd.conf.j2

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ Match Group sftponly
256256

257257
{% for item in ssh_server_match_group %}
258258
Match Group {{ item.group }}
259-
{{ item.rules | indent(4) }}
259+
{% for rule in item.rules %}
260+
{{ rule | indent(4) }}
261+
{% endfor %}
260262
{% endfor %}
261263
{% endif %}
262264

@@ -267,6 +269,8 @@ Match Group {{ item.group }}
267269

268270
{% for item in ssh_server_match_user %}
269271
Match User {{ item.user }}
270-
{{ item.rules | indent(4) }}
272+
{% for rule in item.rules %}
273+
{{ rule | indent(4) }}
274+
{% endfor %}
271275
{% endfor %}
272276
{% endif %}

tests/default_custom.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@
4747
#ssh_server_enabled: false
4848
ssh_server_match_group:
4949
- group: 'root'
50-
rules: 'AllowTcpForwarding yes'
50+
rules:
51+
- 'AllowTcpForwarding yes'
52+
- 'PermitTTY no'
5153
ssh_server_match_user:
5254
- user: 'root'
53-
rules: 'AllowTcpForwarding yes'
55+
rules:
56+
- 'AllowTcpForwarding yes'
57+
- 'PermitTTY no'
5458
ssh_remote_hosts:
5559
- names: ['example.com', 'example2.com']
5660
options: ['Port 2222', 'ForwardAgent yes']

0 commit comments

Comments
 (0)