Check Password Strength

Check if a password meets strength requirements (8+ chars, uppercase, lowercase, number, special).

Code

General
[[ ${#password} -ge 8 && "$password" =~ [a-z] && "$password" =~ [A-Z] && "$password" =~ [0-9] && "$password" =~ [@\$!%*?&] ]] && echo "true" || echo "false"

Parameters

Password to check

Server

More Bash Snippets