dropbear monitor


SUBMITTED BY: Guest

DATE: Feb. 27, 2014, 6:41 p.m.

FORMAT: Text only

SIZE: 520 Bytes

HITS: 69114

  1. #echo "check $PID";
  2. NUM=`cat /var/log/auth.log | grep -i sshd | grep -i "Accepted password for" | grep "sshd\[$PID\]" | wc -l`;
  3. USER=`cat /var/log/auth.log | grep -i sshd | grep -i "Accepted password for" | grep "sshd\[$PID\]" | awk '{print $9}'`;
  4. IP=`cat /var/log/auth.log | grep -i sshd | grep -i "Accepted password for" | grep "sshd\[$PID\]" | awk '{print $11}'`;
  5. if [ $NUM -eq 1 ]; then
  6. echo "$PID - $USER - $IP";
  7. fi

comments powered by Disqus