Joining Debian 8 to Active Directory

#!/bin/bash
# This script should join Debian Jessie (8) to an Active Directory domain.
echo "Please authenticate with your sudo password"
sudo -v
if ! $(sudo which realmd 2>/dev/null); then
    sudo aptitude install realmd adcli sssd
fi
if ! $(sudo which ntpd 2>/dev/null); then
    sudo aptitude install ntp
fi
sudo mkdir -p /var/lib/samba/private
echo "Please enter the domain you wish to join: "
read DOMAIN
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
sudo aptitude install libsss-sudo
echo "%domain\ admins@$DOMAIN ALL=(ALL) ALL" | sudo tee -a /etc/sudoers.d/domain_admins
echo "The computer is joined to the domain.  Please reboot, ensure that you are connected to the network, and you should be able to login with domain credentials."

Alguns links sobre LTSP

https://wiki.debian.org/DebianEdu/Documentation/Stretch/HowTo/NetworkClients#Force_all_thin_clients_to_use_LXDE_as_default_desktop_environment

https://wiki.tolabaki.gr/w/LTSP_Fat_Client_Setup

https://ubuntuforums.org/showthread.php?t=1532100

http://www.panticz.de/node/602

https://help.ubuntu.com/community/UbuntuLTSP/ThinClientProxyRedirect

http://www.suares.com/index.php?page_id=9&show=news&news_id=253

https://help.ubuntu.com/community/UbuntuLTSP/FirefoxOptimize