I created a backup with duplicity with GPG encryption used by below command. When I want to restore a file duplicity asks password for decryption. Any idea why? I use YubiKey 5 to store my GPG private key so it is not password protected, moreover, it asks passphrase for decryption not passphrase of GPG private key.
Earlier I used symmetric encryption too instead of GPG (PASSPHRASE environment variable) but in the meantime both ~/.cache/duplicity directory on client side and full backup set on remote side were deleted.
:/tmp$ duplicity restore --file-to-restore "/home/gabor/test.jpg" sftp://backupmachine//mnt/duplicity/ /tmp/teszt/test.jpg
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sat Aug 27 14:02:43 2022
GnuPG passphrase for decryption:
This is how backup was created:
TARGET='sftp://backupmachine//mnt/duplicity/'
SSH_KEY="${BASE_DIR}/cloud.pem"
GPG_ENCRYPT_OPTS=--encrypt-key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
export DUP_OPT="--ssh-options -oIdentityFile=${SSH_KEY}"
duplicity $DUP_OPT $GPG_ENCRYPT_OPTS --full-if-older-than 3W --include-filelist "$(dirname $0)/gabor1-list.txt" --exclude '**' --exclude "$HOME/.cache/duplicity" / "${TARGET}"
This is how I tested .gpg files they are really encrypted with GPG key instead of symmetric encryption with passphrase:
:/tmp$ gpg -d duplicity-new-signatures.20220827T120243Z.to.20220828T010003Z.sigtar.gpg > x
gpg: encrypted with 4096-bit RSA key, ID xxxxxxxxxxxxxxxx, created 2022-05-27
"me <email@address.tld>"
:/tmp$ file x
x: POSIX tar archive