summaryrefslogtreecommitdiff
path: root/src/systemd
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-19 17:07:42 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-19 17:07:42 +0200
commite3fdb3c4f2b2b94e241ecd82dcb032020bbc1718 (patch)
tree43a869c1dc2f406d02bca7d55bacc1418dae3048 /src/systemd
parenta686e090b2bd19ce27d3d09318d63208448e0707 (diff)
parent9130507c08a88a46325efe7e95ed74126ec6cec8 (diff)
downloadvyos-1x-e3fdb3c4f2b2b94e241ecd82dcb032020bbc1718.tar.gz
vyos-1x-e3fdb3c4f2b2b94e241ecd82dcb032020bbc1718.zip
Merge branch 'console-server' of github.com:c-po/vyos-1x into current
* 'console-server' of github.com:c-po/vyos-1x: console-server: T2490: set service priority to 990 op-mode: console-server: T2490: rename "connect console-server" to "connect console" console-server: T2490: server must listen only on localhost op-mode: add "show ip ports" to list local opened ports console-server: T2490: add SSH support for direct device access op-mode: console-server: T2490: get connection info console-server: T2490: remove superfluous "port" node from XML definition console-server: T2490: rename CLI to console-server console-server: T2490: add SSH support console-server: T2490: log to journald console-server: T2490: move CLI parsing to get_config_dict() console-server: T2490: replace ser2net with conserver op-mode: T2490: add "connect serial-proxy" CLI command console-server: T2490: add default CLI values console-server: T2490: rename CLI to "serial-proxy" console-server: T2490: use new USB ports "by-bus" console-server: T2490: use "ls" for completion helper console-server: T2490: initial support
Diffstat (limited to 'src/systemd')
-rw-r--r--src/systemd/dropbear@.service14
-rw-r--r--src/systemd/dropbearkey.service11
2 files changed, 25 insertions, 0 deletions
diff --git a/src/systemd/dropbear@.service b/src/systemd/dropbear@.service
new file mode 100644
index 000000000..606a7ea6d
--- /dev/null
+++ b/src/systemd/dropbear@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Dropbear SSH per-connection server
+Requires=dropbearkey.service
+Wants=conserver-server.service
+ConditionPathExists=/run/conserver/conserver.cf
+After=dropbearkey.service vyos-router.service conserver-server.service
+
+[Service]
+Type=forking
+ExecStartPre=/usr/bin/bash -c '/usr/bin/systemctl set-environment PORT=$(cli-shell-api returnActiveValue service console-server device "%I" ssh port)'
+ExecStart=-/usr/sbin/dropbear -w -j -k -r /etc/dropbear/dropbear_rsa_host_key -c "/usr/bin/console %I" -P /run/conserver/dropbear.%I.pid -p ${PORT}
+PIDFile=/run/conserver/dropbear.%I.pid
+KillMode=process
+Restart=on-failure
diff --git a/src/systemd/dropbearkey.service b/src/systemd/dropbearkey.service
new file mode 100644
index 000000000..770641c8b
--- /dev/null
+++ b/src/systemd/dropbearkey.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Dropbear SSH Key Generation
+ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
+
+[Service]
+ExecStart=/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+