Created
March 9, 2020 09:11
-
-
Save avilum/8c19fcd4b2e18143f9bd95c129591d8c to your computer and use it in GitHub Desktop.
Print the names of the users that failed to connect to a machine using ssh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /var/log/auth.log | grep -i -e "disconnected from invalid user" | awk -F' ' '{print $10}' | sort | uniq # INVALID LOGINS USERNAMES (for bash autocompletion and reverse-i search) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can be copied and pasted in your ssh server,
to re-execute on the same machine just ctrl+r and start typing "INVALID", "LOGINS", or "USERNAMES" in uppercase.