diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-14 21:34:52 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-14 21:34:52 +0200 |
commit | dbfc2add3434638628b43ecfa097fbd166c85db7 (patch) | |
tree | ab219e511f48223fe18168e4bd9c3f4a1854c346 | |
parent | b0acc3a58f75f01ff19dbc9544e681cfc9d50c8e (diff) | |
download | vyos-1x-dbfc2add3434638628b43ecfa097fbd166c85db7.tar.gz vyos-1x-dbfc2add3434638628b43ecfa097fbd166c85db7.zip |
ssh: T4353: fix Jinja2 linting errors
-rw-r--r-- | data/templates/ssh/override.conf.j2 (renamed from data/templates/ssh/override.conf.tmpl) | 0 | ||||
-rw-r--r-- | data/templates/ssh/sshd_config.j2 (renamed from data/templates/ssh/sshd_config.tmpl) | 20 | ||||
-rwxr-xr-x | src/conf_mode/ssh.py | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/data/templates/ssh/override.conf.tmpl b/data/templates/ssh/override.conf.j2 index e4d6f51cb..e4d6f51cb 100644 --- a/data/templates/ssh/override.conf.tmpl +++ b/data/templates/ssh/override.conf.j2 diff --git a/data/templates/ssh/sshd_config.tmpl b/data/templates/ssh/sshd_config.j2 index d39b47669..e7dbca581 100644 --- a/data/templates/ssh/sshd_config.tmpl +++ b/data/templates/ssh/sshd_config.j2 @@ -52,9 +52,9 @@ PasswordAuthentication {{ "no" if disable_password_authentication is vyos_define {% if listen_address is vyos_defined %} # Specifies the local addresses sshd should listen on -{% for address in listen_address %} +{% for address in listen_address %} ListenAddress {{ address }} -{% endfor %} +{% endfor %} {% endif %} {% if ciphers is vyos_defined %} @@ -73,22 +73,22 @@ KexAlgorithms {{ key_exchange | join(',') }} {% endif %} {% if access_control is vyos_defined %} -{% if access_control.allow.user is vyos_defined %} +{% if access_control.allow.user is vyos_defined %} # If specified, login is allowed only for user names that match AllowUsers {{ access_control.allow.user | join(' ') }} -{% endif %} -{% if access_control.allow.group is vyos_defined %} +{% endif %} +{% if access_control.allow.group is vyos_defined %} # If specified, login is allowed only for users whose primary group or supplementary group list matches AllowGroups {{ access_control.allow.group | join(' ') }} -{% endif %} -{% if access_control.deny.user is vyos_defined %} +{% endif %} +{% if access_control.deny.user is vyos_defined %} # Login is disallowed for user names that match DenyUsers {{ access_control.deny.user | join(' ') }} -{% endif %} -{% if access_control.deny.group is vyos_defined %} +{% endif %} +{% if access_control.deny.group is vyos_defined %} # Login is disallowed for users whose primary group or supplementary group list matches DenyGroups {{ access_control.deny.group | join(' ') }} -{% endif %} +{% endif %} {% endif %} {% if client_keepalive_interval is vyos_defined %} diff --git a/src/conf_mode/ssh.py b/src/conf_mode/ssh.py index 67724b043..487e8c229 100755 --- a/src/conf_mode/ssh.py +++ b/src/conf_mode/ssh.py @@ -84,8 +84,8 @@ def generate(ssh): syslog(LOG_INFO, 'SSH ed25519 host key not found, generating new key!') call(f'ssh-keygen -q -N "" -t ed25519 -f {key_ed25519}') - render(config_file, 'ssh/sshd_config.tmpl', ssh) - render(systemd_override, 'ssh/override.conf.tmpl', ssh) + render(config_file, 'ssh/sshd_config.j2', ssh) + render(systemd_override, 'ssh/override.conf.j2', ssh) # Reload systemd manager configuration call('systemctl daemon-reload') |