aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar steering72532026-05-15 18:29:30 -0600
committerGravatar steering72532026-05-15 18:29:30 -0600
commit8c235aff0108e9fdaf7df2fccf55c2f3cdf6e44a (patch)
treecaa7ad228a2e7f71c4f6d1c474d9afa3d3886583
parentadd bind9-dnsutils and dn42 hostkeys (diff)
fix pubkeys with comments
-rwxr-xr-xauthorized_keys.sh2
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