Update ADconnection.sh

This commit is contained in:
PierreGode 2019-02-11 13:35:12 +01:00 committed by GitHub
parent 803a424d02
commit 4d4c6501f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,7 +265,7 @@ then
echo "Files seems already to be modified, skipping..." echo "Files seems already to be modified, skipping..."
else else
echo "NOTICE! /etc/ssh/login.group.allowed will be created. make sure yor local user is in it you you could be banned from login" echo "NOTICE! /etc/ssh/login.group.allowed will be created. make sure yor local user is in it you you could be banned from login"
echo "auth required pam_listfile.so onerr=fail item=group sense=allow file=/etc/ssh/login.group.allowed" | sudo tee -a /etc/pam.d/system-auth echo "auth required pam_listfile.so onerr=fail item=group sense=allow file=/etc/ssh/login.group.allowed" | sudo tee -a /etc/pam.d/sshd
sudo touch /etc/ssh/login.group.allowed sudo touch /etc/ssh/login.group.allowed
admins=$( cat /etc/passwd | grep home | grep bash | cut -d ':' -f1 ) admins=$( cat /etc/passwd | grep home | grep bash | cut -d ':' -f1 )
echo "" echo ""
@ -412,7 +412,7 @@ if [ $states1 = 12 ]
then then
echo "Disabled SSH login.group.allowed" echo "Disabled SSH login.group.allowed"
else else
cauth=$(cat /etc/pam.d/system-auth | grep required | grep onerr | grep allow | cut -d '=' -f4 | awk '{print $1}') cauth=$(cat /etc/pam.d/sshd | grep required | grep onerr | grep allow | cut -d '=' -f4 | awk '{print $1}')
if [ $cauth = allow ] < /dev/null > /dev/null 2>&1 if [ $cauth = allow ] < /dev/null > /dev/null 2>&1
then then
echo "Checking PAM auth configuration.. OK" echo "Checking PAM auth configuration.. OK"