diff options
Diffstat (limited to 'EndoForge/openssh/AuthorizedKeysCommand')
-rwxr-xr-x | EndoForge/openssh/AuthorizedKeysCommand | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/EndoForge/openssh/AuthorizedKeysCommand b/EndoForge/openssh/AuthorizedKeysCommand new file mode 100755 index 0000000..063444e --- /dev/null +++ b/EndoForge/openssh/AuthorizedKeysCommand | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/bin/sh | ||
2 | fingerprint=$3 | ||
3 | authline="$4 $5" | ||
4 | |||
5 | username=$(id -un) | ||
6 | userhome=$(getent passwd $(id -un) | (IFS=: read _ _ _ _ _ home _ && echo "$home")) | ||
7 | |||
8 | case "$userhome" in | ||
9 | '' | *"'"* ) exit ;; | ||
10 | esac | ||
11 | |||
12 | usercommand=$userhome/.ssh/AnonymousAccessCommand | ||
13 | |||
14 | [ -x "$usercommand" ] || exit | ||
15 | |||
16 | printf 'command="%s",no-port-forwarding %s\n' "$usercommand $fingerprint" "$authline" | ||