My question is, how do i edit the script such that if PASS_MAX_DAYS is equals to 14 days or less then it equals to “Vulnerability: No”? Output My Script Answer You can use grep -oP “^PASS_MAX_DAYSs+K([0-9]+)” /etc/login.defs to extract the value : K starts the match from the position of the value ([0-9]+)
Tag: audit
Bash Scripting: How to display output for checking root logins via SSH not allowed?
My question is, how do i make the script into a if else statement that it checks if “PermitRootLogin no”, it should display the “Vulnerability: No” and if the “PermitRootLogin yes” it should display as “Vulnerability: Yes”? Thanks in advance! Output Script Answer you can use variables to store the command output. This script should do what you need-