Questions tagged [gpg]

gpg is the main command line tool of the GNU Privacy Guard (GnuPG), implementing the OpenPGP standard for public key cryptography. It allows encryption, (verification of) signatures and trust models like the web of trust. gpg (and its library gpgme) are the base of many FOSS crypto applications (like mail user agents). There is a standalone version (1.x) and one (2.x) requiring gpg-agent for secret key handling.

GNU implementation of OpenPGP, the cryptographic toolset : http://gnupg.org/

List of GUIs: https://www.gnupg.org/related_software/frontends.html

687 questions
313
votes
3 answers

How to import secret gpg key (copied from one machine to another)?

I'm trying to copy my gpg key from one machine to another. I do: gpg --export ${ID} > public.key gpg --export-secret-key ${ID} > private.key Move files to new machine, and then: gpg --import public.key gpg: nyckel [ID]: public key [Name, e-mail]…
user50849
  • 5,082
  • 5
  • 25
  • 30
231
votes
4 answers

How to export a GPG private key and public key to a file

I have generated keys using GPG, by executing the following command gpg --gen-key Now I need to export the key pair to a file; i.e., private and public keys to private.pgp and public.pgp, respectively.  How do I do it?
rocky
  • 2,413
  • 2
  • 7
  • 5
133
votes
3 answers

gpg: keyserver receive failed: No dirmngr

While trying to receive keys in my Debian Stretch server, I get this error: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF Executing: /tmp/apt-key-gpghome.4B7hWtn7Rm/gpg.1.sh…
Hunter.S.Thompson
  • 8,839
  • 7
  • 26
  • 41
131
votes
3 answers

How to renew an expired keypair with gpg

What is the best way to renew a gpg key pair when it got expired and what is the reason for the method? The key pair is already signed by many users and available on public servers. Should the new key be a subkey of the expired private key? Should…
Jonas Stein
  • 3,898
  • 4
  • 34
  • 55
124
votes
20 answers

gpg asks for password even with --passphrase

I expect the following command to extract the gpg file without asking for password: gpg --passphrase 1234 file.gpg But it asks for the password. Why? This also have the same behavior: gpg --passphrase-file passfile.txt file.gpg I use Ubuntu…
Omid
  • 3,311
  • 8
  • 34
  • 40
87
votes
9 answers

keyserver timed out when trying to add a GPG public key

I am trying to add a public key for installing a program with CPG. But I am pretty new to this but every command I found gave me the same error: gpg --keyserver keyserver.ubuntu.com --recv-keys 94558F59 gpg: requesting key 94558F59 from hkp server…
Sander Van der Zeeuw
  • 1,501
  • 2
  • 13
  • 15
83
votes
7 answers

How are the GPG usage flags defined in the key details listing?

When I list the details of a key I get output like this: $ gpg --edit-key SOMEID pub [..] created: [..] expires: [..] usage:SC [..] sub [..] created: [..] expires: [..] usage: E Or even usage: SCA on another key (the master-key part). What does…
maxschlepzig
  • 56,316
  • 50
  • 205
  • 279
64
votes
12 answers

gpg: keyserver receive failed: Server indicated a failure

This error has arise when I add gns repository and try to use this command: #sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F88F6D313016330404F710FC9A2FD067A2E3EF7B the error is: gpg: keyserver receive failed: Server indicated a…
Govinda Chaulagain
  • 739
  • 1
  • 6
  • 8
61
votes
4 answers

Unable to add gpg key with apt-key behind a proxy

Adding a gpg key via apt-key systematically fails since I've switched to Ubuntu 17.04 (I doubt it's directly related though). Example with Spotify's repo key: $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys…
Anto
  • 771
  • 2
  • 6
  • 13
58
votes
1 answer

gpg —list-keys command outputs uid [ unknown ] after importing private key onto a clean install

I did a clean install of Arch Linux and imported my backed up gpg private key. As a sanity check I ran: gpg —list-keys Everything showed up as normal except for the uid which now reads: uid [ unknown ] User < [email protected] > When I first…
user223600
57
votes
7 answers

How can I find out what keys gpg-agent has cached? (like how ssh-add -l shows you cached ssh keys)

ssh-add -l shows you all ssh-keys that have been added with ssh-add ~/.ssh/id_yourkey. How do I do the analogous thing with gpg and gpg-agent, in other words, ask it to show a list of cached keys?
user3243135
  • 827
  • 2
  • 8
  • 10
53
votes
1 answer

gpg: WARNING: unsafe ownership on homedir '/home/user/.gnupg'

System: I am testing Linux Mint 19 Beta based on Ubuntu 18.04. I got this warning while installing an unrelated package: gpg: WARNING: unsafe ownership on homedir '/home/vlastimil/.gnupg' This is the ls output the of the directory itself: $ lld…
Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309
46
votes
1 answer

How does GPG agent work?

I have a line in my gpg.conf file which says use-agent. I understand this refers to gpg-agent which is a daemon. The man page states "gpg-agent is a daemon to manage secret (private) keys independently from any protocol. It is used as a backend for…
SauceCode
  • 2,275
  • 4
  • 21
  • 32
45
votes
2 answers

Set default key in gpg for signing

I have created multiple keys using gpg. Whenever I try to sign any file, gpg automatically uses the first one I have created. How to set default key for signing in gpg. I don't want to delete/revoke the other one yet. Otherwise, how can I…
Aman Sharma
  • 551
  • 1
  • 4
  • 5
43
votes
6 answers

gpg does not ask for password

I encrypted one file with gpg -c and closed the terminal. After a while, I tried to decrypt it with gpg and it decrypted it, without asking for a password. Is that normal? How to guarantee that gpg will ask for a password, even in my…
Pierre B
  • 2,143
  • 6
  • 23
  • 38
1
2 3
45 46