diff options
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;')" |
