Update domainjoin.sh
This commit is contained in:
@@ -1,26 +1,33 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
wget -O - http://repo.pbis.beyondtrust.com/apt/RPM-GPG-KEY-pbis|sudo apt-key add -
|
if [[ -f /etc/debian_version ]]; then
|
||||||
wget -O /etc/apt/sources.list.d/pbiso.list http://repo.pbis.beyondtrust.com/apt/pbiso.list
|
wget -O - http://repo.pbis.beyondtrust.com/apt/RPM-GPG-KEY-pbis|sudo apt-key add -
|
||||||
apt update
|
wget -O /etc/apt/sources.list.d/pbiso.list http://repo.pbis.beyondtrust.com/apt/pbiso.list
|
||||||
|
apt update
|
||||||
|
apt install -y pbis-open
|
||||||
|
fi
|
||||||
|
|
||||||
apt install -y pbis-open
|
if [[ -f /etc/redhat-release ]]; then
|
||||||
|
wget -O /etc/yum.repos.d/pbiso.repo http://repo.pbis.beyondtrust.com/yum/pbiso.repo
|
||||||
|
yum clean all
|
||||||
|
yum install pbis-open
|
||||||
|
fi
|
||||||
|
|
||||||
# sudo wget -O /etc/yum.repos.d/pbiso.repo http://repo.pbis.beyondtrust.com/yum/pbiso.repo
|
# ask for the domain, username, and password
|
||||||
|
read -p "Enter Domain name: " -i "home.johnhgaunt.com" domain
|
||||||
|
read -p "Enter netBIOS name: " -i "GAUNT" netbiosname
|
||||||
|
read -p "Enter Domain Admin username: " -i "jgaunt" username
|
||||||
|
read -s -p "Enter Password: " password
|
||||||
|
|
||||||
# yum install pbis-open
|
domainjoin-cli join $domain $username $password
|
||||||
|
|
||||||
domainjoin-cli join home.johnhgaunt.com jgaunt
|
/opt/pbis/bin/config UserDomainPrefix $netbiosname
|
||||||
|
|
||||||
# Enter password here
|
|
||||||
|
|
||||||
/opt/pbis/bin/config UserDomainPrefix GAUNT
|
|
||||||
/opt/pbis/bin/config AssumeDefaultDomain true
|
/opt/pbis/bin/config AssumeDefaultDomain true
|
||||||
/opt/pbis/bin/config LoginShellTemplate /bin/bash
|
/opt/pbis/bin/config LoginShellTemplate /bin/bash
|
||||||
/opt/pbis/bin/config HomeDirTemplate %H/%U
|
/opt/pbis/bin/config HomeDirTemplate %H/%U
|
||||||
|
|
||||||
echo "## ad.johnhgaunt.com Admins ##" >> /etc/sudoers.d/GauntAD
|
echo "## $domain Admins ##" >> /etc/sudoers.d/$netbiosnameAD
|
||||||
echo "# Allow members of Gaunt\Domain Admins group sudo access" >> /etc/sudoers.d/GauntAD
|
echo "# Allow members of $netbiosname\Domain Admins group sudo access" >> /etc/sudoers.d/$netbiosnameAD
|
||||||
echo "%Domain^Admins ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/GauntAD
|
echo "%Domain^Admins ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/$netbiosnameAD
|
||||||
|
|
||||||
reboot
|
reboot
|
||||||
|
|||||||
Reference in New Issue
Block a user