Files
Server-scripts/serverhost/ServerLoginTracker.sh
T

9 lines
457 B
Bash
Raw Normal View History

2026-04-14 23:55:21 +02:00
#!/bin/bash
#SSH
cat /var/log/auth.log | grep sshd | grep -E "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | grep ": Failed"| cut -f1-3,6,7,11 -d' '
cat /var/log/auth.log | grep sshd | grep -E "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | grep "Accepted" | cut -f1-3,6,7,11 -d' '
#NextCloud
cat /nextcloud/nextcloud/access.log | grep -v dummy | cut -f1 -d' ' | sort | uniq -c
cat /nextcloud/nextcloud/access.log | grep -v dummy | cut -f2 -d'"' | cut -f1 -d' ' | sort | uniq -c