diff options
Diffstat (limited to 'src/AuthorizedKeysCommand')
-rwxr-xr-x | src/AuthorizedKeysCommand | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/AuthorizedKeysCommand b/src/AuthorizedKeysCommand index 6bf0ec9..de0732a 100755 --- a/src/AuthorizedKeysCommand +++ b/src/AuthorizedKeysCommand | |||
@@ -1,7 +1,11 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | cmd=/etc/ssh/user-d.AnonymousForceCommand | 2 | username=$1 |
3 | shift | ||
4 | |||
5 | [ "$username" ] | ||
6 | cmd=/etc/ssh/user-$username.AnonymousForceCommand | ||
3 | [ -x "$cmd" ] || exit | 7 | [ -x "$cmd" ] || exit |
4 | 8 | ||
5 | key=$1 | 9 | key=$1 |
6 | shift | 10 | shift |
7 | printf 'restrict,pty,command="%s" %s\n' "$cmd $*" "$key" | 11 | printf 'restrict,pty,command="%s" %s\n' "$cmd" "$key" |