summaryrefslogtreecommitdiff
path: root/src/openssh
diff options
context:
space:
mode:
Diffstat (limited to 'src/openssh')
-rw-r--r--src/openssh/AnonymousForceCommand2
-rw-r--r--src/openssh/AuthorizedKeysCommand11
-rw-r--r--src/openssh/fossil-user.conf3
3 files changed, 16 insertions, 0 deletions
diff --git a/src/openssh/AnonymousForceCommand b/src/openssh/AnonymousForceCommand
new file mode 100644
index 0000000..cc69ce3
--- /dev/null
+++ b/src/openssh/AnonymousForceCommand
@@ -0,0 +1,2 @@
1#!/bin/sh
2exec socat stdio /run/fossil-user.S
diff --git a/src/openssh/AuthorizedKeysCommand b/src/openssh/AuthorizedKeysCommand
new file mode 100644
index 0000000..de0732a
--- /dev/null
+++ b/src/openssh/AuthorizedKeysCommand
@@ -0,0 +1,11 @@
1#!/bin/sh
2username=$1
3shift
4
5[ "$username" ]
6cmd=/etc/ssh/user-$username.AnonymousForceCommand
7[ -x "$cmd" ] || exit
8
9key=$1
10shift
11printf 'restrict,pty,command="%s" %s\n' "$cmd" "$key"
diff --git a/src/openssh/fossil-user.conf b/src/openssh/fossil-user.conf
new file mode 100644
index 0000000..86387e7
--- /dev/null
+++ b/src/openssh/fossil-user.conf
@@ -0,0 +1,3 @@
1ExposeAuthInfo=yes
2AuthorizedKeysCommandUser=root
3AuthorizedKeysCommand=/etc/ssh/AuthorizedKeysCommand "%u" "%t %k"