8 January 2024
AshSeems not for me. I am sharing one example n need like this
You are not supposed to send pic.. write the code and error message..
One can help you, if they have knowledge and time..
Don’t upload the pic or screenshot
SuneelTry to allow pictures as well
No, it will be messy… one can’t copy or edit the code in pictures..
It’s not allowed or it will be allowed to send in pictures
AshI need like this
BACKUP_DIR=/opt/mysql/data/backup/Latest_Backup
BACKUP_PASS="Vk1PMnR1="
DPASS='echo $BACKUP_PASS |base64 --decode
I need like means ?
What exactly you are asking? Your question is half incomplete…
AshMeans I want to create first the encrypted password like this n then d pass in Linux
Again incorrect information…
Do you want now to decode? The above code is encoding, and now what next you need ?
ENCRYPTED_PASS=$(echo -n "xyz@12345" | openssl enc -aes-256-cbc -a -salt)
Store it as below
BACKUP_PASS="$ENCRYPTED_PASS"
Decrypt as below if you intend to use somewhere
DECRYPTED_PASS=$(echo "$BACKUP_PASS" | openssl enc -aes-256-cbc -a -d -salt)
Use it as below in your script as below
👇
mysql -u your_username -p"$DECRYPTED_PASS" -h your_host your_database
AshI am really sorry if I am unable share proper information. Actually I have a mysql db password like xyz@12345 now I want to encrypt this n then how to D pass this in Linux so that I cn use my password in script
In simple you are asking to decrypt it for using somewhere right ?
Make your question easier to understand