Add omarchy-doctor

This commit is contained in:
Ryan Hughes
2025-09-28 00:41:37 -04:00
parent 0b172dbef1
commit 57a977a51d
40 changed files with 1032 additions and 356 deletions

View File

@@ -1,3 +1,16 @@
# Increase lockout limit to 10 and decrease timeout to 2 minutes
sudo sed -i 's|^\(auth\s\+required\s\+pam_faillock.so\)\s\+preauth.*$|\1 preauth silent deny=10 unlock_time=120|' "/etc/pam.d/system-auth"
sudo sed -i 's|^\(auth\s\+\[default=die\]\s\+pam_faillock.so\)\s\+authfail.*$|\1 authfail deny=10 unlock_time=120|' "/etc/pam.d/system-auth"
OMARCHY_DESCRIPTION="Lockout Limit"
omarchy_install() {
# Increase lockout limit to 10 and decrease timeout to 2 minutes
sudo sed -i 's|^\(auth\s\+required\s\+pam_faillock.so\)\s\+preauth.*$|\1 preauth silent deny=10 unlock_time=120|' "/etc/pam.d/system-auth"
sudo sed -i 's|^\(auth\s\+\[default=die\]\s\+pam_faillock.so\)\s\+authfail.*$|\1 authfail deny=10 unlock_time=120|' "/etc/pam.d/system-auth"
}
omarchy_verify() {
[[ -f /etc/pam.d/system-auth ]] || add_error "PAM system-auth file missing"
if [[ -f /etc/pam.d/system-auth ]]; then
grep -q "pam_faillock.so.*deny=10" /etc/pam.d/system-auth || add_error "Faillock deny limit not set to 10"
grep -q "pam_faillock.so.*unlock_time=120" /etc/pam.d/system-auth || add_error "Faillock unlock time not set to 120"
fi
}