Article 54EQ8 gpg decrypt file fails: No secret key

gpg decrypt file fails: No secret key

by
Sum1
from LinuxQuestions.org on (#54EQ8)
1. Digitalocean cloud-based CentOS7 machine using (GnuPG) 2.0.22 encrypts a file:

Code:gpg -e --passphrase-file /home/abc/phrase.txt --batch -r john@johnsmith.com /home/abc/somefile.tar.gz2. The public key on the cloud-based CentOS7 is then exported:

Code:gpg --output public.gpg --armor --export john@johnsmith.com3. The encrypted file, the pass-phrase file, and public key is then obtained and imported on Local Fedora 32 machine:

Code:scp john@cloud-centos7:/home/abc/phrase.txt /home/johnCode:scp john@cloud-centos7:/home/abc/somefile.tar.gz.gpg /home/johnCode:scp john@cloud-centos7:/home/abc/public.gpg /home/johnCode:gpg --import public.gpg4. Attempts to decrypt the file using the passphrase file and without it fail:

Code:gpg --passphrase-file /home/john/phrase.txt --batch -d --output /home/john/somefile.tar.gz /home/john/somefile.tar.gz.gpg
gpg: encrypted with 2048-bit RSA key, ID XXXXXXXXXXXXXXXXXX, created 2019-11-23
"john smith <john@johnsmith.com>"
gpg: decryption failed: No secret key
[mhf@zxc ~]$ gpg -d --output /home/john/somefile.tar.gz /home/john/somefile.tar.gz.gpg
gpg: encrypted with 2048-bit RSA key, ID XXXXXXXXXXXXXXXXXX, created 2019-11-23
"john smith <john@johnsmith.com>"
gpg: decryption failed: No secret keyI cannot determine why the imported gpg public key won't work and why gpg complains that a secret key is needed.

Thank you for reading.latest?d=yIl2AUoC8zA latest?i=CRvuK3WvaQU:nUfILmv5xA8:F7zBnMy latest?i=CRvuK3WvaQU:nUfILmv5xA8:V_sGLiP latest?d=qj6IDK7rITs latest?i=CRvuK3WvaQU:nUfILmv5xA8:gIN9vFwCRvuK3WvaQU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments