mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Update ADconnection.sh
This commit is contained in:
parent
579093548e
commit
746cc401fe
@ -7,7 +7,6 @@
|
||||
# #
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
# ~~~~~~~~~~ Environment Setup ~~~~~~~~~~ #
|
||||
NORMAL=`echo "\033[m"`
|
||||
MENU=`echo "\033[36m"` #Blue
|
||||
@ -131,9 +130,7 @@ sed -i -e 's/use_fully_qualified_names = True/use_fully_qualified_names = False/
|
||||
echo "override_homedir = /home/%d/%u" >> /etc/sssd/sssd.conf
|
||||
eof
|
||||
}
|
||||
|
||||
####################### Setup for Ubuntu 14 server #######################################
|
||||
|
||||
ubuntuserver14(){
|
||||
sudo wget http://download.beyondtrust.com/PBISO/8.0.1/linux.deb.x64/pbis-open-8.0.1.2029.linux.x86_64.deb.sh
|
||||
sudo chmod 777 pbis-open-8.0.1.2029.linux.x86_64.deb.sh
|
||||
@ -184,52 +181,37 @@ sudo cat /etc/sudoers | grep $Group
|
||||
echo "In SSH allow file..."
|
||||
sudo cat /etc/ssh/login.group.allowed | grep $Group
|
||||
echo "If this is wrong DO NOT REBOOT and contact sysadmin"
|
||||
|
||||
}
|
||||
|
||||
|
||||
####################### Setup for Debian client #######################################
|
||||
|
||||
# This script should join Debian Jessie (8) to an Active Directory domain.
|
||||
debianclient(){
|
||||
export HOSTNAME
|
||||
myhost=$( hostname )
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install libsss-sudo -y
|
||||
sudo apt-get install realmd adcli sssd -y
|
||||
sudo apt-get install ntp -y
|
||||
sudo mkdir -p /var/lib/samba/private
|
||||
|
||||
clear
|
||||
echo "Please enter the domain you wish to join: "
|
||||
read DOMAIN
|
||||
|
||||
echo "Please enter Your domain’s NetBios name"
|
||||
read NetBios
|
||||
|
||||
echo "Please enter a domain admin login to use: "
|
||||
read ADMIN
|
||||
|
||||
sudo realm join --user=$ADMIN $DOMAIN
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "AD join failed. Please run 'journalctl -xn' to determine why."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo systemctl enable sssd
|
||||
sudo systemctl start sssd
|
||||
|
||||
echo "session required pam_mkhomedir.so skel=/etc/skel/ umask=0022" | sudo tee -a /etc/pam.d/common-session
|
||||
|
||||
# configure sudo
|
||||
|
||||
echo "Please enter new user without @mydomain"
|
||||
read newuser
|
||||
echo "%domain\ admins@$DOMAIN ALL=(ALL) ALL" | sudo tee -a /etc/sudoers.d/domain_admins
|
||||
sudo echo "$newuser"'@'"$DOMAIN"" ALL=(ALL:ALL) ALL" >> /etc/sudoers
|
||||
|
||||
while true; do
|
||||
read -p 'Do you want to Reboot now? (y/n)?' yn
|
||||
case $yn in
|
||||
@ -290,10 +272,7 @@ sed -i -e 's/use_fully_qualified_names = True/use_fully_qualified_names = False/
|
||||
echo "override_homedir = /home/%d/%u" >> /etc/sssd/sssd.conf
|
||||
eof
|
||||
}
|
||||
|
||||
|
||||
############################### Reauth ##########################################
|
||||
|
||||
Reauthenticate14(){
|
||||
echo "Reauth for Likewise only!"
|
||||
echo "Type domain"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user