0

I made a script that auto backups of my Keepass DB to Google Drive

So first it is encrypted, but I would like signing too

I used 2 systems, a Mac Mini (Intel) (2c/2t, 16G RAM) and a Ubuntu 20.04 VPS (8c/16t, 16G RAM)

Using the same command :

gpg -vvv --yes --batch -r <REDACTED> --passphrase-file /home/stig124/pkx --output ~/bak/secbak-140421_20.tar.xz3 --encrypt --sign ~/bak/secbak-140421_2002.tar.xz

On the Mac, it works just fine, but on Ubuntu it always fails with the log saying nothing

gpg: using character set 'utf-8'
gpg: using pgp trust model
gpg: key 6CF8D3A4170BD77B: accepted as trusted key
gpg: using subkey 524151A99DEC9CA3 instead of primary key 6CF8D3A4170BD77B
gpg: automatically retrieved <REDACTED> via Local
gpg: This key belongs to us
gpg: writing to '/home/stig124/bak/secbak-140421_20.tar.xz3'
gpg: RSA/AES256 encrypted for: <REDACTED>"

It halts on that forever

Removing signing solves the issue but I have absolutely no idea why it is failing, is there a fix possible?

Ubuntu GPG ver. 2.2.19 (latest available on Ubuntu 20.04 repos)

gpg (GnuPG) 2.2.19
libgcrypt 1.8.5
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/stig124/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

MacOS 11.2.3 GPG ver. 2.2.27 (latest GPG Suite-shipped version)

gpg (GnuPG) 2.2.27
libgcrypt 1.9.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /Users/stig124/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

1 Answer 1

0

gpg -vvv --yes --batch -r --passphrase-file /home/stig124/pkx --output ~/bak/secbak-140421_20.tar.xz3 --encrypt --sign ~/bak/secbak-140421_2002.tar.xz

If using --passphrase-file you also need to include --pinentry-mode loopback:

gpg -vvv --pinentry-mode loopback --yes --batch -r <REDACTED> --passphrase-file /home/stig124/pkx --output ~/bak/secbak-140421_20.tar.xz3 --encrypt --sign ~/bak/secbak-140421_2002.tar.xz

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.