I'm setting up a backup from a local machine to a remote server.
I generated gpg keys on the local machine and ran a test backup with:
PASSPHRASE="MyGPGPassphrase" duplicity --encrypt-key KeyID test scp://user@server/path
The backup seems to work fine, three files are created on the server.
My problem is I can't get the restore to work.
I deleted the test file on the local machine and try to restore it with:
PASSPHRASE="MyGPGPassphrase" duplicity --encrypt-key KeyID scp://user@server/path test
I get the following error:
Synchronizing remote metadata to local cache... Copying duplicity-full-signatures.20151011T011134Z.sigtar.gpg to local cache. GPGError: GPG Failed, see log below: ===== Begin GnuPG log ===== gpg: encrypted with 2048-bit RSA key, ID KeyID(of ssb), created 2015-10-11 "Name <email>" gpg: public key decryption failed: Inappropriate ioctl for device gpg: decryption failed: No secret key ===== End GnuPG log =====
I exported the gpg keys on the local machine with:
gpg --export-secret-key KeyID > secret.key
gpg --armor --export KeyID > public.key
And imported them on the server with:
gpg --import secret.key
gpg --import public.key
Is there anything else that needs to be done for the restore to work?
If I execute the command without the PASSPHRASE env
duplicity --encrypt-key Key D test scp://user@host/path the backup is created anyway without asking for the passphrase.
file duplicity-full.20151011T115714Z.vol1.difftar.gpg lists a different KeyID then the one specified in --encrypt-key. I dont have the listed key in my keyring.