summaryrefslogtreecommitdiff
path: root/EndoForge/openssh/run-sshd
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-24 06:15:10 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-24 06:18:45 -0400
commit5e1f460dd3bf6288893ae61429a94dd90d19cdfb (patch)
treec0811cf81cbdcad19d0f7bd84b26350ad3835310 /EndoForge/openssh/run-sshd
parent187db8e649641aa64dc49c29ea6bbeba1f7cabf7 (diff)
Removing run-sshd script
I realized that if you are running `sshd` as a user, then you can just use `ForceCommand=` directly in the `sshd_config`. This eliminates the need for fakeroot. And that simplifies the setup enough so that the `openssh/` directory can go away.
Diffstat (limited to 'EndoForge/openssh/run-sshd')
-rwxr-xr-xEndoForge/openssh/run-sshd32
1 files changed, 0 insertions, 32 deletions
diff --git a/EndoForge/openssh/run-sshd b/EndoForge/openssh/run-sshd
deleted file mode 100755
index 20e82d8..0000000
--- a/EndoForge/openssh/run-sshd
+++ /dev/null
@@ -1,32 +0,0 @@
1#!/bin/sh
2# Fix file ownership with fakeroot so that OpenSSH will run as a user.
3#
4# The ownership is not really changed on disk, but 'chmod go-w' might actually
5# change permissions on disk.
6
7case "$LD_PRELOAD" in
8 libfakeroot-sysv.so) ;;
9 '') exec fakeroot -- "$0" "$@" ;;
10 *) exit 1 ;;
11esac
12
13fixperms()
14{
15 set -- "$1"
16 local p="$1" oldp=
17 while [ "$p" != "$oldp" ]
18 do
19 oldp=$p
20 p=${p%/*}/
21 set -- "$@" "$p"
22 done
23 chown root:root "$@"
24 chmod go-w "$@"
25}
26
27fixperms "$HOME"/.ssh
28
29PATH=/sbin:/usr/sbin:$PATH
30cmd="$(which sshd) $*"
31runuser -u "$USER" -- sh -c "$cmd"
32