diff options
| author | 2026-04-28 23:28:25 +0000 | |
|---|---|---|
| committer | 2026-04-28 23:28:25 +0000 | |
| commit | 38fca7692e900589338eade8b5667a483575f5af (patch) | |
| tree | f5b1e3e8eb4e9fa98e21f10fa0e54776c191e01e | |
| parent | update cronjob installation (diff) | |
add logging
| -rwxr-xr-x | authorized_keys.sh | 2 | ||||
| -rwxr-xr-x | install.sh | 4 | ||||
| -rwxr-xr-x | log_autopeer_shell.sh | 3 | ||||
| -rw-r--r-- | sshd_config | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/authorized_keys.sh b/authorized_keys.sh index d16588f..b8a016c 100755 --- a/authorized_keys.sh +++ b/authorized_keys.sh @@ -19,6 +19,8 @@ if [ "$1" = "new" ]; then echo "[autopeer $(hostname)] New user being created: $user from $key $connection" | socat stdio "$NOTIFY_TO" /usr/sbin/adduser --disabled-password --quiet --comment "created at $(date +%s) by $key ${connection//:/_}" --ingroup autopeer "$user" /usr/sbin/adduser "$user" bird + ( umask 0077; touch "/var/log/autopeer/$user".{tim,io}; ) + chown "$user" "/var/log/autopeer/$user".{tim,io} fi fi else # not new user @@ -27,3 +27,7 @@ umask 0022 wg pubkey </etc/wireguard/privkey >/etc/wireguard/pubkey chmod 711 /etc/wireguard + +mkdir /var/log/autopeer +chmod 1770 /var/log/autopeer +chown root:autopeer /var/log/autopeer diff --git a/log_autopeer_shell.sh b/log_autopeer_shell.sh new file mode 100755 index 0000000..29253c9 --- /dev/null +++ b/log_autopeer_shell.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +SHELL=/opt/autopeer/autopeer_shell.py script -q -a --log-timing "/var/log/autopeer/$USER.tim" --log-io "/var/log/autopeer/$USER.io" diff --git a/sshd_config b/sshd_config index 3b5e925..1afda01 100644 --- a/sshd_config +++ b/sshd_config @@ -22,4 +22,4 @@ Match group autopeer PermitOpen none PermitTunnel no PermitUserRC no - ForceCommand /opt/autopeer/autopeer_shell.py + ForceCommand /opt/autopeer/log_autopeer_shell.sh |
