summaryrefslogtreecommitdiffstats
path: root/src/ssh-generator/20-systemd-ssh-proxy.conf.in
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-01-04 23:31:51 +0100
committerLennart Poettering <lennart@poettering.net>2024-01-11 16:05:20 +0100
commit0abd510f7f628d0369f0814b671302e93c62b161 (patch)
tree5634a8ec751cde1f6edc87a5df55f3dc245d2c4f /src/ssh-generator/20-systemd-ssh-proxy.conf.in
parentssh-generator: add simple new generator (diff)
downloadsystemd-0abd510f7f628d0369f0814b671302e93c62b161.tar.xz
systemd-0abd510f7f628d0369f0814b671302e93c62b161.zip
ssh-proxy: add ssh ProxyCommand tool that can connect to AF_UNIX + AF_VSOCK sockets
This adds a tiny binary that is hooked into SSH client config via ProxyCommand and which simply connects to an AF_UNIX or AF_VSOCK socket of choice. The syntax is as simple as this: ssh unix/some/path # (this connects to AF_UNIX socket /some/path) or: ssh vsock/4711 I used "/" as separator of the protocol ID and the value since ":" is already taken by SSH itself when doing sftp. And "@" is already taken for separating the user name.
Diffstat (limited to 'src/ssh-generator/20-systemd-ssh-proxy.conf.in')
-rw-r--r--src/ssh-generator/20-systemd-ssh-proxy.conf.in18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ssh-generator/20-systemd-ssh-proxy.conf.in b/src/ssh-generator/20-systemd-ssh-proxy.conf.in
new file mode 100644
index 0000000000..b97e0f5340
--- /dev/null
+++ b/src/ssh-generator/20-systemd-ssh-proxy.conf.in
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# Make sure unix/* and vsock/* can be used to connect to AF_UNIX and AF_VSOCK paths
+#
+Host unix/* vsock/*
+ ProxyCommand {{LIBEXECDIR}}/systemd-ssh-proxy %h %p
+ ProxyUseFdpass yes
+ CheckHostIP no
+
+ # Disable all kinds of host identity checks, since these addresses are generally ephemeral.
+ StrictHostKeyChecking no
+ UserKnownHostsFile /dev/null
+
+# Allow connecting to the local host directly via ".host"
+Host .host
+ ProxyCommand {{LIBEXECDIR}}/systemd-ssh-proxy unix/run/ssh-unix-local/socket %p
+ ProxyUseFdpass yes
+ CheckHostIP no