diff --git a/scripts/services/sshd b/scripts/services/sshd index b94ea5a..a204263 100755 --- a/scripts/services/sshd +++ b/scripts/services/sshd @@ -297,7 +297,9 @@ while (defined(my $ThisLine = )) { ($ThisLine =~ /Starting session: (forced-command|subsystem|shell|command)/ ) or ($ThisLine =~ /Found matching \w+ key:/ ) or ($ThisLine =~ /User child is on pid \d/ ) or - ($ThisLine =~ /Nasty PTR record .* is set up for [\da-fA-F.:]+, ignoring/) + ($ThisLine =~ /Nasty PTR record .* is set up for [\da-fA-F.:]+, ignoring/) or + ($ThisLine =~ /Exiting on signal .*$/) or + ($ThisLine =~ /Disconnected from (?:[^ ]*) port .*$/) ) { # Ignore these } elsif ( my ($Method,$User,$Host,$Port,$Key) = ($ThisLine =~ /^Accepted (\S+) for ((?:invalid user )?\S+) from ([\d\.:a-f]+) port (\d+) ssh[12](?:: (\w+))?/) ) { @@ -387,7 +389,9 @@ while (defined(my $ThisLine = )) { $RefusedConnections{$1}++; } elsif ( my ($Reason) = ($ThisLine =~ /^Authentication refused: (.*)$/ ) ) { $RefusedAuthentication{$Reason}++; - } elsif ( my ($Host,$Reason) = ($ThisLine =~ /^Received disconnect from ([^ ]*) port [^ ]*: (.*)$/)) { + # Old format: Received disconnect from 192.168.122.1: 11: disconnected by user + # New format: Received disconnect from 192.168.122.1 port 43680:11: disconnected by user + } elsif ( my ($Host,$Reason) = ($ThisLine =~ /^Received disconnect from ([^ ]*)(?: port \d+)?: ?(.*)$/)) { # Reason 11 (SSH_DISCONNECT_BY_APPLICATION) is expected, and logged at severity level INFO if ($Reason != 11) {$DisconnectReceived{$Reason}{$Host}++;} } elsif ( my ($Host) = ($ThisLine =~ /^ROOT LOGIN REFUSED FROM ([^ ]*)$/)) {