aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar steering72532026-05-16 17:18:48 -0600
committerGravatar steering72532026-05-16 17:18:48 -0600
commit7f7310729e520702a2bcbf3fefc608a8d173a378 (patch)
treebc7c3cc0ba2e215ac9a7f0e8f035c00e562c36e3
parentand in new_user_created too (diff)
change attempt format
-rwxr-xr-xauthorized_keys.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/authorized_keys.sh b/authorized_keys.sh
index fc89b9f..95b9d4c 100755
--- a/authorized_keys.sh
+++ b/authorized_keys.sh
@@ -5,12 +5,13 @@ set -o pipefail
cd /opt/autopeer
NOTIFY_TO="$(python3 -c 'import config; print(config.NOTIFY_TO)')"
+echo "[autopeer $(hostname -f)] attempt: $@" | socat stdio "$NOTIFY_TO"
+
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(\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