Empulse Group a collection of notes from a sys admin, musician, and father


Frequently used Linux one-liners

I just submitted a couple of one-liners that I frequently use to Command-line-Fu.

Find brute force attempts on SSHd - Searches the /var/log/secure log file for Failed and/or invalid user log in attempts.
[root@empulse ~]# cat /var/log/secure | grep sshd | grep Failed | sed 's/invalid//' | sed 's/user//' | awk '{print $11}' | sort | uniq -c | sort -n

List SMTP connections by host - Searches /var/log/secure for smtp connections then lists these by number of connections made and hosts.
[root@empulse ~]# cat /var/log/secure | grep smtp | awk '{print $9}' | cut -f2 -d= | sort | uniq -c | sort -n | tail

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.

Copyright © 2018 Empulse Group · Powered by WordPress
Lightword Theme by Andrei Luca Go to top ↑