summaryrefslogtreecommitdiff
path: root/data/templates/ssh
diff options
context:
space:
mode:
Diffstat (limited to 'data/templates/ssh')
-rw-r--r--data/templates/ssh/override.conf.tmpl12
-rw-r--r--data/templates/ssh/sshd_config.tmpl4
2 files changed, 9 insertions, 7 deletions
diff --git a/data/templates/ssh/override.conf.tmpl b/data/templates/ssh/override.conf.tmpl
index 1013d4b48..4276366ae 100644
--- a/data/templates/ssh/override.conf.tmpl
+++ b/data/templates/ssh/override.conf.tmpl
@@ -1,8 +1,10 @@
+{% set vrf_command = '/sbin/ip vrf exec ' + vrf + ' ' if vrf is defined else '' %}
+[Unit]
+StartLimitIntervalSec=0
+After=vyos-router.service
+
[Service]
ExecStart=
-{% if vrf %}
-ExecStart=/sbin/ip vrf exec {{ vrf }} /usr/sbin/sshd -D $SSHD_OPTS
-{% else %}
-ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
-{% endif %}
+ExecStart={{vrf_command}}/usr/sbin/sshd -D $SSHD_OPTS
+RestartSec=10
diff --git a/data/templates/ssh/sshd_config.tmpl b/data/templates/ssh/sshd_config.tmpl
index 1c136bb23..4fde24255 100644
--- a/data/templates/ssh/sshd_config.tmpl
+++ b/data/templates/ssh/sshd_config.tmpl
@@ -46,7 +46,7 @@ Port {{ value }}
{% endif %}
# Gives the verbosity level that is used when logging messages from sshd
-LogLevel {{ loglevel }}
+LogLevel {{ loglevel | upper }}
# Specifies whether password authentication is allowed
PasswordAuthentication {{ "no" if disable_password_authentication is defined else "yes" }}
@@ -57,7 +57,7 @@ PasswordAuthentication {{ "no" if disable_password_authentication is defined els
ListenAddress {{ listen_address }}
{% else %}
{% for address in listen_address %}
-ListenAddress {{ value }}
+ListenAddress {{ address }}
{% endfor %}
{% endif %}
{% endif %}