mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Create ADconnection.sh
This commit is contained in:
parent
e1c214cc9d
commit
f402616847
@ -129,11 +129,17 @@ sudo touch /etc/ssh/login.group.allowed
|
||||
sudo echo "administrator" | sudo tee -a /etc/ssh/login.group.allowed
|
||||
sudo echo "$NetBios"'\'"$myhost""sudoers" | sudo tee -a /etc/ssh/login.group.allowed
|
||||
sudo echo "$NetBios"'\'"domain^admins" | sudo tee -a /etc/ssh/login.group.allowed
|
||||
sudoersfile=$(cat /etc/sudoers.d/sudoes | grep $myhost)
|
||||
if [ "$sudoesfile" -eq "$myhost" ]
|
||||
then
|
||||
echo "Sudoersfile seems already to be modified.. skipping...."
|
||||
else
|
||||
sudo echo "administrator ALL=(ALL:ALL) ALL" | sudo tee -a /etc/sudoers.d/sudoers
|
||||
sudo echo "%$myhost""sudoers ALL=(ALL:ALL) ALL" | sudo tee -a /etc/sudoers.d/sudoers
|
||||
sudo echo "%domain\ users ALL=(ALL:ALL) ALL" | sudo tee -a /etc/sudoers.d/sudoers
|
||||
sudo echo "%DOMAIN\ admins ALL=(ALL) ALL" | sudo tee -a /etc/sudoers.d/domain_admins
|
||||
#sudo realm permit --groups "$myhost""sudoers"
|
||||
fi
|
||||
therealm=$(realm discover $DOMAIN | grep -i configured: | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//')
|
||||
if [ $therealm = no ]
|
||||
then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user