![]() ![]() ![]() Suser=$(grep "$yday" $MYPATH | grep "Accepted password|Accepted publickey|keyboard-interactive" | wc -l)įuser=$(grep "$yday" $MYPATH | grep "Failed password" | wc -l) Tuser=$(grep "$yday" $MYPATH | grep "Accepted|Failed" | wc -l) This script allows you to verify user access information for a given date from the terminal.Įcho -e "Enter the Date, Use Double Space for date from 1 to 9 (Nov 3) and use Single Space for date from 10 to 31 (Nov 30): \c" Method-1 : Shell Script to Check Successful and Failed User Login Attempts on Linux The second bash script allows you to send a mail with user access information on a daily basis. The first shell script allows you to verify user access information for any date available in the “/var/log/secure” file. Also, it shows successful login attempts and failed login attempts. These scripts will show the number of users logged into the system for a given date. I’ve included two shell scripts in this tutorial. Yes, you can achieve this using the following Bash script. To make this easier and more effective, we need to write a bash script. It is very difficult to manually verify them because the output of the “/var/log/secure” file looks awkward. This ensures that there are no illegal attempts at the environment. One of the typical tasks of Linux administrators is to check successful and failed login attempts in the Linux system. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |