mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-26 18:59:26 -05:00
improve console lockdown info output
This commit is contained in:
parent
788914de95
commit
20697db3ee
@ -5,7 +5,14 @@
|
||||
|
||||
grep_result="$(grep "accessfile=/etc/security/access-security-misc.conf" /etc/pam.d/common-account 2>/dev/null)"
|
||||
|
||||
## Check if grep matched something.
|
||||
if [ ! "$grep_result" = "" ]; then
|
||||
## Yes, grep matched.
|
||||
|
||||
## Check if not out commented.
|
||||
if ! echo "$grep_result" | grep -q "#" ; then
|
||||
## Not out commented indeed.
|
||||
|
||||
## https://forums.whonix.org/t/etc-security-hardening-console-lockdown/8592
|
||||
|
||||
if id --name --groups --zero "$PAM_USER" | grep --quiet --null-data --line-regexp --fixed-strings "console"; then
|
||||
@ -14,6 +21,7 @@ if ! echo "$grep_result" | grep -q "#" ; then
|
||||
if id --name --groups --zero "$PAM_USER" | grep --quiet --null-data --line-regexp --fixed-strings "console-unrestricted"; then
|
||||
console_allowed=true
|
||||
fi
|
||||
|
||||
if [ ! "$console_allowed" = "true" ]; then
|
||||
echo "$0: ERROR: PAM_USER: '$PAM_USER' is not a member of group 'console'" >&2
|
||||
echo "$0: To unlock, run the following command as superuser:" >&2
|
||||
@ -29,6 +37,7 @@ if ! echo "$grep_result" | grep -q "#" ; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
## https://forums.whonix.org/t/how-strong-do-linux-user-account-passwords-have-to-be-when-using-full-disk-encryption-fde-too/7698
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user