diff options
| author | 2026-04-08 16:36:59 +0000 | |
|---|---|---|
| committer | 2026-04-08 16:36:59 +0000 | |
| commit | bca037330893403ee20e8d6381db9b375c137c19 (patch) | |
| tree | 835cb4262c48f012a2bf15691400736134094855 /authorized_keys.sh | |
| parent | shorten wg name (diff) | |
misc fixes
Diffstat (limited to 'authorized_keys.sh')
| -rwxr-xr-x | authorized_keys.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/authorized_keys.sh b/authorized_keys.sh index 867d153..1ee9f73 100755 --- a/authorized_keys.sh +++ b/authorized_keys.sh @@ -6,9 +6,10 @@ user="$1" if [ "$1" = "new" ]; then type="$2" 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 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" --ingroup autopeer "$user" + /usr/sbin/adduser --disabled-password --quiet --comment "created at $(date +%s) by $key $connection" --ingroup autopeer "$user" fi else # not new user 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;')" |
