Update ADconnection.sh

This commit is contained in:
PierreGoude 2017-06-22 09:57:44 +02:00 committed by GitHub
parent a605dac6ab
commit 7c475aa8f3

View File

@ -698,9 +698,28 @@ else
echo Checking PAM auth configuration.. "${RED_TEXT}"FAIL ssh security not configured"${END}" echo Checking PAM auth configuration.. "${RED_TEXT}"FAIL ssh security not configured"${END}"
fi fi
realm discover realm discover
echo "-------------------------------------------------------------------------------------"
realm list
exit exit
} }
#################################### ldapsearch #####################################################
ldaplook(){
export HOSTNAME
myhost=$( hostname )
if [ -f /etc/ldap/ldap.conf ]
then
echo "ldap tool installed.. verifying setup"
sudo ldapsearch | grep -i $myhost
else
sudo apt-get install ldap-tools -y
echo "please edit ldap.conf"
sudo nano /etc/ldap/ldap.conf
sudo ldapsearch | grep -i $myhost
fi
}
############################### Reauth ########################################## ############################### Reauth ##########################################
Reauthenticate14(){ Reauthenticate14(){
DOMAIN=$(realm discover | grep -i realm.name | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//') DOMAIN=$(realm discover | grep -i realm.name | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//')
@ -752,11 +771,11 @@ clear
echo "${INTRO_TEXT} This script will edit several critical files.. ${INTRO_TEXT}" echo "${INTRO_TEXT} This script will edit several critical files.. ${INTRO_TEXT}"
echo "${INTRO_TEXT} DO NOT attempt this without expert knowledge ${INTRO_TEXT}" echo "${INTRO_TEXT} DO NOT attempt this without expert knowledge ${INTRO_TEXT}"
echo "${NORMAL} ${NORMAL}" echo "${NORMAL} ${NORMAL}"
echo "${MENU}*${NUMBER} 1)${MENU} Setup AD on Ubuntu Client ${NORMAL}" echo "${MENU}*${NUMBER} 1)${MENU} Setup AD on Ubuntu Client or Server ${NORMAL}"
echo "${MENU}*${NUMBER} 2)${MENU} Setup AD on Ubuntu 14 Server ${NORMAL}" echo "${MENU}*${NUMBER} 2)${MENU} Setup AD on Debian Jessie Client ${NORMAL}"
echo "${MENU}*${NUMBER} 3)${MENU} Setup AD on Debian Jessie Client ${NORMAL}" echo "${MENU}*${NUMBER} 3)${MENU} Setup AD on Debian CentOS ${NORMAL}"
echo "${MENU}*${NUMBER} 4)${MENU} Setup AD on Debian CentOS ${NORMAL}" echo "${MENU}*${NUMBER} 4)${MENU} Check for errors ${NORMAL}"
echo "${MENU}*${NUMBER} 5)${MENU} Check for errors ${NORMAL}" echo "${MENU}*${NUMBER} 5)${MENU} Chech in ldap ${NORMAL}"
echo "${MENU}*${NUMBER} 6)${MENU} Reauthenticate (Ubuntu14 only) ${NORMAL}" echo "${MENU}*${NUMBER} 6)${MENU} Reauthenticate (Ubuntu14 only) ${NORMAL}"
echo "${MENU}*${NUMBER} 7)${MENU} Update from Likewise to Realmd for Ubuntu 14 ${NORMAL}" echo "${MENU}*${NUMBER} 7)${MENU} Update from Likewise to Realmd for Ubuntu 14 ${NORMAL}"
echo "${MENU}*${NUMBER} 8)${MENU} README with examples ${NORMAL}" echo "${MENU}*${NUMBER} 8)${MENU} README with examples ${NORMAL}"
@ -770,28 +789,28 @@ while [ opt != '' ]
else else
case $opt in case $opt in
1) clear; 1) clear;
echo "Installing on Ubuntu Client"; echo "Installing on Ubuntu Client/Server";
ubuntuclient; ubuntuclient;
;; ;;
2) clear; 2) clear;
echo "Installing on Ubuntu 14 Server"; echo "Installing on Debian Jessie client";
ubuntuserver14 debianclient
;; ;;
3) clear; 3) clear;
echo "Installing on Debian Jessie client"
debianclient
;;
4) clear;
echo "Installing on Debian Cent OS" echo "Installing on Debian Cent OS"
CentOS CentOS
;; ;;
5) clear; 4) clear;
echo "Check for errors" echo "Check for errors"
failcheck failcheck
;;
5) clear;
echo "Check in Ldap"
ldaplook
;; ;;
6) clear; 6) clear;