mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 16:50:13 +01:00
Update ADconnection.sh
This commit is contained in:
parent
b72c2a1ae9
commit
0ad2544e9e
@ -93,12 +93,35 @@ sudo echo "$NetBios"'\'"$myhost""sudoers" >> /etc/ssh/login.group.allowed
|
|||||||
sudo echo "%domain^admins ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/sudoers
|
sudo echo "%domain^admins ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/sudoers
|
||||||
sudo echo "%$myhost""sudoers ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/sudoers
|
sudo echo "%$myhost""sudoers ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/sudoers
|
||||||
sudo echo "%DOMAIN\ admins@$DOMAIN ALL=(ALL) ALL" >> /etc/sudoers.d/domain_admins
|
sudo echo "%DOMAIN\ admins@$DOMAIN ALL=(ALL) ALL" >> /etc/sudoers.d/domain_admins
|
||||||
echo "Check that the group is correct"
|
therealm=$(realm discover | grep -i configured: | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//')
|
||||||
echo "In Sudoers file..."
|
guest=$(cat /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf | grep -i allow-guest | grep -i false | cut -d '=' -f2)
|
||||||
sudo cat /etc/sudoers.d/sudoers | grep sudoers
|
if [ $therealm = no ]
|
||||||
echo "In SSH allow file..."
|
then
|
||||||
sudo cat /etc/ssh/login.group.allowed | grep $myhost
|
echo Realm configured?.. "${RED_TEXT}"FAIL"${END}"
|
||||||
echo "If this is wrong DO NOT REBOOT and contact sysadmin"
|
else
|
||||||
|
echo Realm configured?.. "${INTRO_TEXT}"OK"${END}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/sudoers.d/sudoers ]
|
||||||
|
then
|
||||||
|
echo Checking sudoers file.. "${INTRO_TEXT}"OK"${END}"
|
||||||
|
grouPs=$(cat /etc/sudoers.d/sudoers | grep -i $myhost | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g')
|
||||||
|
if [ $grouPs = "$myhost""sudoers" ]
|
||||||
|
then
|
||||||
|
echo Checking sudoers users.. "${INTRO_TEXT}"OK"${END}"
|
||||||
|
else
|
||||||
|
echo Checking sudoers users.. "${RED_TEXT}"FAIL"${END}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo checking sudoers file.. "${RED_TEXT}"FAIL"${END}"
|
||||||
|
echo Checking sudoers users.. "${RED_TEXT}"FAIL"${END}"
|
||||||
|
fi
|
||||||
|
if [ $guest = false ]
|
||||||
|
then
|
||||||
|
echo Checking login configuration.. "${INTRO_TEXT}"OK"${END}"
|
||||||
|
else
|
||||||
|
echo Checking login configuration.. "${RED_TEXT}"FAIL"${END}"
|
||||||
|
fi
|
||||||
exec sudo -u root /bin/sh - <<eof
|
exec sudo -u root /bin/sh - <<eof
|
||||||
sed -i -e 's/fallback_homedir = \/home\/%u@%d/#fallback_homedir = \/home\/%u@%d/g' /etc/sssd/sssd.conf
|
sed -i -e 's/fallback_homedir = \/home\/%u@%d/#fallback_homedir = \/home\/%u@%d/g' /etc/sssd/sssd.conf
|
||||||
sed -i -e 's/use_fully_qualified_names = True/use_fully_qualified_names = False/g' /etc/sssd/sssd.conf
|
sed -i -e 's/use_fully_qualified_names = True/use_fully_qualified_names = False/g' /etc/sssd/sssd.conf
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user