Jump to content

gpg: Go ahead and type your message … after every command in bash

I'm trying to encrypt my backup with GPG using asymmetric encryption, i have tried many many different lines to encrypt my backup.tar.gz file:

gpg --encrypt --batch --no-tty --yes --output "backup.$(date +"%Y-%m-%d")" --recipient EMAILOFMYPGPKEY "backup.tar.gz"
gpg --encrypt --batch --no-tty --yes --output "backup.$(date +"%Y-%m-%d")" --recipient EMAILOFMYPGPKEY "backup.tar.gz"
gpg --set-filename "backup.$(date +"%Y-%m-%d").tar.gz" -e -r EMAILOFMYPGPKEY "backup.tar.gz"
gpg -e "backup.tar.gz" --default-recipient --batch --no-tty --yes --output "backup.$(date +"%Y-%m-%d").tar.gz"
gpg -e -o "backup.$(date +"%Y-%m-%d").tar.gz" --recipient EMAILOFMYPGPKEY --batch "backup.tar.gz"
gpg2 -e --recipient AE86B6C7 --output "backup.$(date +"%Y-%m-%d").tar.gz.gpg" --batch --no-tty "backup.tar.gz"
gpg2 --batch --no-tty --yes --output "$filename" --recipient ANOTHEREMAILOFMYPGPKEY "backup.tar.gz"
echo "ASECUREPASSPHRASE" | gpg2 --passphrase-fd 0 -r EMAILOFMYPGPKEY --output "backup.$(date +"%Y-%m-$

this runs from a bash script as root, and every time the file is correctly created but gpg asks

gpg: Go ahead and type your message ...

pressing the ctrl+d ends by bash script, I would like for gpg to simply encrypt my file and not prompt for a message at the end. I feel like there is a simple solution but I have not managed to find it...

Edited by guillaumedsde
typo fix
Link to comment
Share on other sites

Link to post
Share on other sites

If I understand right what you're trying to do:

 

gpg --recipient someone --encrypt < filetoencrypt > outputfile
 

You could also use --armor if you want an ASCII file instead of a binary one.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×