updated encryption to pkeyutl

updated encryption to pkeyutl
This commit is contained in:
PierreGode 2022-10-10 13:49:47 +02:00 committed by GitHub
parent 0c679f65b6
commit f68f964b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -841,7 +841,7 @@ UbuntU(){
export HOSTNAME export HOSTNAME
myhost=$( hostname | cut -d '.' -f1 ) myhost=$( hostname | cut -d '.' -f1 )
clear clear
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
sudo echo "${NUMBER}Installing packages do no abort!.......${END}" sudo echo "${NUMBER}Installing packages do no abort!.......${END}"
if ! sudo apt-get -qq install realmd adcli sssd ntp curl -y && sudo apt-get -qq install -f -y if ! sudo apt-get -qq install realmd adcli sssd ntp curl -y && sudo apt-get -qq install -f -y
then then
@ -928,7 +928,7 @@ if [ "$encrypt" = "yes" ]
then then
if [ -f private_key.pem ] && [ -f public_key.pem ] if [ -f private_key.pem ] && [ -f public_key.pem ]
then then
enc=$(sudo openssl rsautl -decrypt -inkey private_key.pem -in encrypted.dat ) enc=$(sudo openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted.dat )
if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/ if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
then then
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}" echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
@ -985,7 +985,7 @@ if [ "$encrypt" = "yes" ]
then then
if [ -f private_key.pem ] && [ -f public_key.pem ] if [ -f private_key.pem ] && [ -f public_key.pem ]
then then
enc=$(sudo openssl rsautl -decrypt -inkey private_key.pem -in encrypted.dat ) enc=$(sudo openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted.dat )
if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/ if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
then then
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}" echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
@ -1018,17 +1018,17 @@ if [ -f /etc/apt/sources.list.d/aroth-ubuntu-ppa-eoan.list ]
then then
sudo apt-get update sudo apt-get update
#sudo apt-get --only-upgrade install adcli #sudo apt-get --only-upgrade install adcli
sudo apt install adcli=0.8.2-1 -y --allow-downgrades #sudo apt install adcli -y
else else
echo"" echo""
echo "Fixing krb5.keytab: Bad encryption type for ubuntu 19.10 - 20.04" echo "Fixing krb5.keytab: Bad encryption type for ubuntu 19.10 - 20.04"
echo "" echo ""
echo "To avoid encryption error with adcli please accept PPA below for an adcli update" echo "To avoid encryption error with adcli please accept PPA below for an adcli update"
echo "" echo ""
sudo add-apt-repository ppa:aroth/ppa #sudo add-apt-repository ppa:aroth/ppa
sudo apt-get update sudo apt-get update
#sudo apt-get --only-upgrade install adcli #sudo apt-get --only-upgrade install adcli
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
echo "" echo ""
fi fi
fi fi
@ -1064,7 +1064,7 @@ if [ "$encrypt" = "yes" ]
then then
if [ -f private_key.pem ] && [ -f public_key.pem ] if [ -f private_key.pem ] && [ -f public_key.pem ]
then then
enc=$(sudo openssl rsautl -decrypt -inkey private_key.pem -in encrypted.dat ) enc=$(sudo openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted.dat )
if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/ if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
then then
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}" echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
@ -1100,7 +1100,7 @@ Zorin_os(){
export HOSTNAME export HOSTNAME
myhost=$( hostname | cut -d '.' -f1 ) myhost=$( hostname | cut -d '.' -f1 )
clear clear
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
sudo echo "${NUMBER}Installing packages do no abort!.......${END}" sudo echo "${NUMBER}Installing packages do no abort!.......${END}"
if ! sudo apt-get -qq install realmd adcli sssd ntp curl -y && sudo apt-get -qq install -f -y if ! sudo apt-get -qq install realmd adcli sssd ntp curl -y && sudo apt-get -qq install -f -y
then then
@ -1187,7 +1187,7 @@ if [ "$encrypt" = "yes" ]
then then
if [ -f private_key.pem ] && [ -f public_key.pem ] if [ -f private_key.pem ] && [ -f public_key.pem ]
then then
enc=$(sudo openssl rsautl -decrypt -inkey private_key.pem -in encrypted.dat ) enc=$(sudo openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted.dat )
if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/ if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
then then
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}" echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
@ -1244,7 +1244,7 @@ if [ "$encrypt" = "yes" ]
then then
if [ -f private_key.pem ] && [ -f public_key.pem ] if [ -f private_key.pem ] && [ -f public_key.pem ]
then then
enc=$(sudo openssl rsautl -decrypt -inkey private_key.pem -in encrypted.dat ) enc=$(sudo openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted.dat )
if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/ if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
then then
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}" echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
@ -1277,7 +1277,7 @@ if [ -f /etc/apt/sources.list.d/aroth-ubuntu-ppa-eoan.list ]
then then
sudo apt-get update sudo apt-get update
#sudo apt-get --only-upgrade install adcli #sudo apt-get --only-upgrade install adcli
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
else else
echo"" echo""
echo "" echo ""
@ -1286,7 +1286,7 @@ echo ""
sudo add-apt-repository ppa:aroth/ppa sudo add-apt-repository ppa:aroth/ppa
sudo apt-get update sudo apt-get update
#sudo apt-get --only-upgrade install adcli #sudo apt-get --only-upgrade install adcli
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
echo "" echo ""
fi fi
fi fi
@ -1322,7 +1322,7 @@ if [ "$encrypt" = "yes" ]
then then
if [ -f private_key.pem ] && [ -f public_key.pem ] if [ -f private_key.pem ] && [ -f public_key.pem ]
then then
enc=$(sudo openssl rsautl -decrypt -inkey private_key.pem -in encrypted.dat ) enc=$(sudo openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted.dat )
if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/ if ! echo $enc | sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
then then
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}" echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
@ -1359,7 +1359,7 @@ export HOSTNAME
myhost=$( hostname | cut -d '.' -f1 ) myhost=$( hostname | cut -d '.' -f1 )
clear clear
sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}" sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}"
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
sudo apt-get -qq install realmd adcli sssd -y sudo apt-get -qq install realmd adcli sssd -y
sudo apt-get -qq install ntp -y sudo apt-get -qq install ntp -y
sudo apt-get -qq install -y sssd-tools samba-common krb5-user curl sudo apt-get -qq install -y sssd-tools samba-common krb5-user curl
@ -1425,7 +1425,7 @@ if [ "$encrypt" = "yes" ]
then then
if [ -f private_key.pem ] && [ -f public_key.pem ] if [ -f private_key.pem ] && [ -f public_key.pem ]
then then
enc=$(sudo openssl rsautl -decrypt -inkey private_key.pem -in encrypted.dat ) enc=$(sudo openssl pkeyutl -decrypt -inkey private_key.pem -in encrypted.dat )
if ! echo $enc | sudo realm join -v -U "$DomainADMIN" "$DOMAIN" --install=/ if ! echo $enc | sudo realm join -v -U "$DomainADMIN" "$DOMAIN" --install=/
then then
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}" echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
@ -1586,7 +1586,7 @@ export whoami
whoamis=$( whoami ) whoamis=$( whoami )
admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 ) admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 )
sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}" sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}"
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
sudo apt-get -qq update sudo apt-get -qq update
sudo apt-get -qq install libsss-sudo -y sudo apt-get -qq install libsss-sudo -y
sudo apt-get -qq install adcli -y sudo apt-get -qq install adcli -y
@ -1747,7 +1747,7 @@ echo "$admins ALL=(ALL:ALL) ALL | tee -a /etc/sudoers.d/admin"
fi fi
clear clear
sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}" sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}"
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
sudo apt-get -qq update sudo apt-get -qq update
sudo apt-get -qq install libsss-sudo -y sudo apt-get -qq install libsss-sudo -y
sudo apt-get -qq install realmd adcli sssd curl -y sudo apt-get -qq install realmd adcli sssd curl -y
@ -2108,7 +2108,7 @@ export HOSTNAME
myhost=$( hostname | cut -d '.' -f1 ) myhost=$( hostname | cut -d '.' -f1 )
sudo apt-get -qq install -y realmd curl sssd sssd-tools samba-common krb5-user sudo apt-get -qq install -y realmd curl sssd sssd-tools samba-common krb5-user
sudo apt-get -qq install -f -y sudo apt-get -qq install -f -y
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
echo "hostname is $myhost" echo "hostname is $myhost"
echo "Looking for Realms.. please wait" echo "Looking for Realms.. please wait"
REALM=$( sudo grep DOMAIN readfile | awk '{print $3}' ) REALM=$( sudo grep DOMAIN readfile | awk '{print $3}' )
@ -2509,7 +2509,7 @@ then
echo "passwd is empty" echo "passwd is empty"
exit exit
else else
sudo openssl rsautl -encrypt -inkey public_key.pem -pubin -in encryptpwd.txt -out encrypted.dat sudo openssl pkeyutl -encrypt -inkey public_key.pem -pubin -in encryptpwd.txt -out encrypted.dat
sudo rm -rf encryptpwd.txt sudo rm -rf encryptpwd.txt
ls ls
fi fi
@ -2816,7 +2816,7 @@ clear
sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}" sudo echo "${RED_TEXT}Installing packages do no abort!.......${END}"
sudo apt-get -qq install realmd curl adcli sssd -y sudo apt-get -qq install realmd curl adcli sssd -y
sudo apt-get -qq install ntp -y sudo apt-get -qq install ntp -y
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
sudo apt-get install -f -y sudo apt-get install -f -y
clear clear
if ! sudo dpkg -l | grep realmd if ! sudo dpkg -l | grep realmd
@ -2864,7 +2864,7 @@ if [ "$var" -eq "14" ]
then then
echo "Installing additional dependencies" echo "Installing additional dependencies"
sudo apt-get -qq install -y realmd curl sssd sssd-tools samba-common krb5-user sudo apt-get -qq install -y realmd curl sssd sssd-tools samba-common krb5-user
sudo apt install adcli=0.8.2-1 -y --allow-downgrades sudo apt install adcli -y
sudo apt-get install -f -y sudo apt-get install -f -y
clear clear
echo "${INTRO_TEXT}Detecting Ubuntu $var${END}" echo "${INTRO_TEXT}Detecting Ubuntu $var${END}"
@ -2906,7 +2906,7 @@ then
if [ -f /etc/apt/sources.list.d/aroth-ubuntu-ppa-eoan.list ] if [ -f /etc/apt/sources.list.d/aroth-ubuntu-ppa-eoan.list ]
then then
sudo apt-get update sudo apt-get update
sudo apt install adcli=0.8.2-1 -y --allow-downgrades --allow-downgrades sudo apt install adcli -y --allow-downgrades
else else
echo"" echo""
echo "Fixing krb5.keytab: Bad encryption type for ubuntu 19.10" echo "Fixing krb5.keytab: Bad encryption type for ubuntu 19.10"