gpgを使用した暗号化は機能しますが、署名暗号化は機能しません。

gpgを使用した暗号化は機能しますが、署名暗号化は機能しません。

Keepass DBをGoogleドライブに自動的にバックアップするスクリプトを作成しました。

まず暗号化されていますが、署名もしたいです。

私はMac Mini(Intel)(2c / 2t、16G RAM)とUbuntu 20.04 VPS(8c / 16t、16G RAM)の2つのシステムを使用しています。

同じコマンドを使用してください。

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

Macではうまく動作しますが、Ubuntuでは常に失敗し、ログには何も表示されません。

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>"

永遠にそこにいる

署名を削除すると問題は解決しますが、なぜ失敗するのかわかりません。回避策はありますか?

Ubuntu GPGのバージョン。2.2.19(最新バージョンはUbuntu 20.04リポジトリで利用可能です)

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.3GPGのバージョン。2.2.27(GPG Suiteに含まれる最新バージョン)

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

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

使用する場合は、--passphrase-file以下も含める必要があります--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

おすすめ記事