I need to save a couple of files on a webserver and would like to have them encrypted with my own public key before.
Therefore I just wrote a simple bash-script:
#!/bin/bash
ls *.7z > filelist.txt
while read currow
do
gpg --encrypt -ac --recipient myemail@example.com $currow
done < filelist.txt
rm filelist.txt
But this doesn't really work. For each file I get this dialog where I have to enter my password (twice).
How can I avoid this? Thank you
You are using the -c
option, which is the short equivalent of the long --symmetric
option. You are not using public key cryptography by using this option, which is why you are asked for a password.
Try changing -ac
to -a
in your script above.