Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
[template] wip ssh users is empty check
Browse files Browse the repository at this point in the history
  • Loading branch information
wookietreiber committed Jul 10, 2023
1 parent 4f0cb76 commit 6cec39b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
5 changes: 4 additions & 1 deletion templates/sshd_config_archlinux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ Subsystem {{ subsystem.name }} {{ subsystem.command }}
# override default of no subsystems
Subsystem sftp /usr/lib/ssh/sftp-server
{% endif %}

{% if ssh_users is defined %}
{% if ssh_users %}

{% for user in ssh_users %}
Match User {{ user.name }}
{% if user.settings is defined %}
Expand All @@ -213,7 +214,9 @@ Match User {{ user.name }}

{% endif %}
{% endfor %}
{% endif %}
{% else %}

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
Expand Down
4 changes: 3 additions & 1 deletion templates/sshd_config_d_90_redhat_9.conf
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ Banner {{ ssh_banner.dest }}
AcceptEnv {{ env }}
{% endfor %}
{% endif %}

{% if ssh_users is defined %}
{% if ssh_users %}

{% for user in ssh_users %}
Match User {{ user.name }}
{% if user.settings is defined %}
Expand All @@ -95,3 +96,4 @@ Match User {{ user.name }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
5 changes: 4 additions & 1 deletion templates/sshd_config_redhat_7.conf
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ Subsystem {{ subsystem.name }} {{ subsystem.command }}
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
{% endif %}

{% if ssh_users is defined %}
{% if ssh_users %}

{% for user in ssh_users %}
Match User {{ user.name }}
{% if user.settings is defined %}
Expand All @@ -235,7 +236,9 @@ Match User {{ user.name }}

{% endif %}
{% endfor %}
{% endif %}
{% else %}

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
Expand Down
5 changes: 4 additions & 1 deletion templates/sshd_config_redhat_8.conf
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ Subsystem {{ subsystem.name }} {{ subsystem.command }}
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
{% endif %}

{% if ssh_users is defined %}
{% if ssh_users %}

{% for user in ssh_users %}
Match User {{ user.name }}
{% if user.settings is defined %}
Expand All @@ -241,7 +242,9 @@ Match User {{ user.name }}

{% endif %}
{% endfor %}
{% endif %}
{% else %}

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
Expand Down
5 changes: 4 additions & 1 deletion templates/sshd_config_ubuntu_16.conf
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ Subsystem {{ subsystem.name }} {{ subsystem.command }}
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
{% endif %}

{% if ssh_users is defined %}
{% if ssh_users %}

{% for user in ssh_users %}
Match User {{ user.name }}
{% if user.settings is defined %}
Expand All @@ -232,7 +233,9 @@ Match User {{ user.name }}

{% endif %}
{% endfor %}
{% endif %}
{% else %}

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
Expand Down
5 changes: 4 additions & 1 deletion templates/sshd_config_ubuntu_18.conf
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ Subsystem {{ subsystem.name }} {{ subsystem.command }}
# override default of no subsystems
Subsystem sftp /usr/lib/ssh/sftp-server
{% endif %}

{% if ssh_users is defined %}
{% if ssh_users %}

{% for user in ssh_users %}
Match User {{ user.name }}
{% if user.settings is defined %}
Expand All @@ -219,7 +220,9 @@ Match User {{ user.name }}

{% endif %}
{% endfor %}
{% endif %}
{% else %}

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
Expand Down
5 changes: 4 additions & 1 deletion templates/sshd_config_ubuntu_20.conf
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ Subsystem {{ subsystem.name }} {{ subsystem.command }}
# override default of no subsystems
Subsystem sftp /usr/lib/ssh/sftp-server
{% endif %}

{% if ssh_users is defined %}
{% if ssh_users %}

{% for user in ssh_users %}
Match User {{ user.name }}
{% if user.settings is defined %}
Expand All @@ -220,7 +221,9 @@ Match User {{ user.name }}

{% endif %}
{% endfor %}
{% endif %}
{% else %}

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
Expand Down

0 comments on commit 6cec39b

Please sign in to comment.