diff options
| -rwxr-xr-x | authorized_keys.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/authorized_keys.sh b/authorized_keys.sh index 6544416..fc89b9f 100755 --- a/authorized_keys.sh +++ b/authorized_keys.sh @@ -11,7 +11,7 @@ if [ "$1" = "new" ]; then key="$3" connection="$4" - if user="$(grep -l -s -r -P '^\s*auth:\s*\Q'"$type"'\E\s+\Q'"$key"'\E$' /opt/autopeer/dn42-registry/data/mntner/ | perl -ne 's@^.*/@@; s@-MNT$@@; print lc;' | head -1)"; then + if user="$(grep -l -s -r -P '^\s*auth:\s*\Q'"$type"'\E\s+\Q'"$key"'\E(\s|$)' /opt/autopeer/dn42-registry/data/mntner/ | perl -ne 's@^.*/@@; s@-MNT$@@; print lc;' | head -1)"; then perl -ne 'print if s@^\s*auth:\s*ssh-@restrict,pty ssh-@' </opt/autopeer/dn42-registry/data/mntner/"$(echo "$user" | perl -ne 's@$@-MNT@; print uc;')" if getent passwd "$user"; then exit 0 |
