mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Update security
Update security
This commit is contained in:
parent
b7e9f086ba
commit
2c2e8bf69e
@ -2482,26 +2482,27 @@ exit
|
|||||||
}
|
}
|
||||||
################################## encrypt pwd ###############################
|
################################## encrypt pwd ###############################
|
||||||
encrypt(){
|
encrypt(){
|
||||||
echo "This will create 3 files public key, private key and encrypted file"
|
echo "This will create 3 files: public key, private key, and encrypted file."
|
||||||
echo "make sure to store private file"
|
echo "Make sure to store the private key file securely."
|
||||||
sudo openssl genrsa -out private_key.pem 2048
|
sudo openssl genrsa -out private_key.pem 2048
|
||||||
sudo openssl rsa -in private_key.pem -out public_key.pem -outform PEM -pubout
|
sudo openssl rsa -in private_key.pem -out public_key.pem -outform PEM -pubout
|
||||||
echo "Please type password to encrypt"
|
|
||||||
stty -echo
|
echo "Please type the password to encrypt:"
|
||||||
read pass
|
stty -echo
|
||||||
echo "$pass" > encryptpwd.txt
|
read pass
|
||||||
stty echo
|
stty echo
|
||||||
if [ -z "$pass" ]
|
if [ -z "$pass" ]; then
|
||||||
then
|
echo "Password is empty"
|
||||||
echo "passwd is empty"
|
exit 1
|
||||||
exit
|
else
|
||||||
else
|
echo -n "$pass" | sudo openssl pkeyutl -encrypt -inkey public_key.pem -pubin -out encrypted.dat
|
||||||
sudo openssl pkeyutl -encrypt -inkey public_key.pem -pubin -in encryptpwd.txt -out encrypted.dat
|
pass=""
|
||||||
sudo rm -rf encryptpwd.txt
|
echo "Encryption complete. Files created:"
|
||||||
ls
|
ls
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
################################## info ##################################
|
################################## info ##################################
|
||||||
readmes(){
|
readmes(){
|
||||||
clear
|
clear
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user