summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauthorized_keys.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/authorized_keys.sh b/authorized_keys.sh
index f64fc72..ec82497 100755
--- a/authorized_keys.sh
+++ b/authorized_keys.sh
@@ -6,7 +6,7 @@ user="$1"
if [ "$1" = "new" ]; then
type="$2"
key="$3"
- connection="$4"
+ connection="$(echo "$4" | tr : _)"
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
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;')"
/usr/sbin/adduser --disabled-password --quiet --comment "created at $(date +%s) by $key $connection" --ingroup autopeer "$user"