KALI – BASH Scripting – How to create a timed lockout for a top secret password
Bash scripting allows us to time a login, where a top secret password is to be used. For this login, we’re going to give the user 20 seconds in which to login, or we’ll lock them out. Secondly the -s option, offers security, as it does not display the password when it’s typed in.
Step 1 – Create the Script in Nano
Here we go!
Step 2 – Test the lockout works
but don’t login – leave it longer than 20 seconds
Yay! The lockout has been triggered.
Step 3 – Enter the password
This part of the code -sp “Enter secret password” doesn’t display the password – which is secure. However the second echo -e….’$secret’ does. So this MUST be removed.
So lets replace the dangerous echo command.
echo -e “\nTop Secret password received.”
Now edit the script to activate a double lockout…
University of South Wales Reading List
Schotts, W.E (2012). The Linux Command Line. San Francisco: No Starch Press. 348-351.
If you fail at Harvard Referencing, it’s an automatic fail of your course, so double check your referencing…