Hot answers tagged

38 votes
Accepted

How to verify a file using an asc signature file?

Download the key file: wget https://ossec.github.io/files/OSSEC-ARCHIVE-KEY.asc Inspect the key file to confirm it has EE1B0E6B2D8387B7 as its keyid. gpg --keyid-format long --list-options show-...
Евгений Новиков's user avatar
23 votes
Accepted

Reprepro export could not find signing key

I had the same problem, and after much frustration finally tracked down what was going on. The reprepro tool uses gpgme, which is based on gnupg2. A recent release of that changed how the secret key ...
Cheetah's user avatar
  • 448
21 votes

How to backup GPG?

First of all, before we begin, [email protected] represents your GPG key ID. This could be your email address or the key ID. Indeed, your private key is critical, but other files are also important. 1. ...
serghei's user avatar
  • 311
20 votes

How to install gpg keys from behind a firewall?

Something like gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 \ --keyserver-options "timeout=40 http-proxy=$http_proxy" \ --recv-keys B0F4253373F8F6F510D42178520A9993A1C052F8 ...
uav's user avatar
  • 564
20 votes
Accepted

Encrypted offsite backup using GPG with private key never on backup server?

This is definitely possible with the --show-session-key and --override-session-key options. First you need the beginning of your encrypted file. This is where the encrypted session key is stored. ...
IsAGuest's user avatar
  • 947
13 votes

How to verify a file using an asc signature file?

This further refines Евгений Новиков's answer. It doesn't use deprecated GnuPG commands and avoids potentially spoofable key IDs for authentication: Download the files Acquire the OpenPGP certificate ...
aef's user avatar
  • 1,755
12 votes

gpg --gen-key hangs at gaining enough entropy on centos 6

https://gist.github.com/franciscocpg/1575d286548034113884c3185ca88681 Open a ssh session sudo apt-get install rng-tools In another SSH window open gpg --gen--key Go back to your first SSH session ...
rhinoceros.xn's user avatar
12 votes

How to export private key? (GnuPG)

Hint 1: gpg calls private keys 'secret' because PGP dates from before people settled on the names 'private' key for the half of an asymmetric pair held by (ideally) only one party versus 'secret' key ...
dave_thompson_085's user avatar
11 votes

How to backup GPG?

In addition to @serghei's answer, check the documentation of gnupg. It says that you should backup: ~/.gnupg/gpg.conf (standard configuration file) ~/.gnupg/pubring.gpg (legacy public keyring) ~/....
Firmin Martin's user avatar
11 votes

Add second sub-key to unattended GPG key

Save for the year 2019, this how you do it in an ephemeral home directory: export GNUPGHOME=$(mktemp -d) gpg --batch --passphrase '' \ --quick-generate-key "Firstname Lastname <lastname@...
sanmai's user avatar
  • 541
10 votes

GPG does not have enough entropy

+1 for rng-tools In case you are stuck in situation as I am - not having permissions to install new software (rng-tools) on a headless server with virtually no input hardware (sound card, keyboard, ...
Raj's user avatar
  • 101
9 votes
Accepted

How can I set up automated, encrypted backups of live MySQL databases on a Ubuntu VPS to Google Drive using Duplicity?

It took me a little over 12 hours to cobble together all the information I needed, but here is the process: Step 1: Google account Choose an existing, or create a new Google account where you will ...
alexw's user avatar
  • 371
9 votes

How to remove a yum repo GPG key?

Using rpm you can list keys and remove them. [root@apps2 ~]# rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n' gpg-pubkey-f4a80eb5-53a7ff4b gpg(CentOS-7 Key (CentOS 7 Official ...
Brian's user avatar
  • 3,486
8 votes

How to generate gpg key without user interaction?

I found there are a few simple changes that make your script work. I have also included a few tests so that once the key is created it will automatically be tested. Note that, unlike the code in the ...
wattry's user avatar
  • 181
8 votes

gpg --gen-key hangs at gaining enough entropy on centos 6

Twist on other responses but at least one liner and not root. ((find / | xargs file) &> /dev/null &); gpg2 --gen-key --batch --passphrase-file output-key.txt key-gen-options.txt Key-gen-...
Dave Brunkow's user avatar
8 votes
Accepted

How to setup logrotate with GPG to encrypt for GDPR?

Contrary to what is often claimed, encryption of all personal data is not mandatory, but only suggested as a good option four times in the whole general data protection regulation (GDPR): "......
Esa Jokinen's user avatar
  • 49.4k
8 votes
Accepted

When installing docker on Ubuntu, why isn't it as easy as apt-get install docker?

Since I wrote this, there are at least two new versions: the snap version (sudo snap install docker), which works well but isn't the latest and does not support all the bells and whistles that the ...
Alexis Wilke's user avatar
  • 2,258
7 votes

How do I import a RSA SSH key into GPG as the _primary_ private key?

You can convert a SSH-Key to a OpenPGP key with the tool pem2openpgp from the monkeysphere project. This key can then be imported by gnupg as a regular private/public key pair. As the other answer ...
user134450's user avatar
7 votes

GPG does not have enough entropy

I was bound and determined to generate entropy on my headless Ubuntu 14.04 server in order to generate a 4096 key with gpg --gen-key There is a package for generating entropy called haveged. Example ...
dmmfll's user avatar
  • 171
7 votes
Accepted

Force the use of a gpg-key as an ssh-key for a given server

I can't do that because my identity is a gpg cardno. You can use IdentityFile and IdentitiesOnly, even with gnupg-provided identities. If you have the card present, export the public key from your ...
anx's user avatar
  • 9,635
6 votes

Add second sub-key to unattended GPG key

To have gpg2 read your commands from stdin, use --command-fd=0. To have gpg2 read the passphrase of the master key from where it reads your commands from, use --pinentry-mode=loopback. (gpg2 --help ...
toomas's user avatar
  • 161
5 votes

How to prevent gpg from creating .gnupg directory in user's home directory

"How to prevent gpg from creating .gnupg directory" I had the same issue as described in the question title while checking some key fingerprints on a read-only mounted disk. The solution I used was ...
Sylvain Leroux's user avatar
5 votes
Accepted

How to remove a yum repo GPG key?

Yum has a GPG keyring for repos that support GPG metadata signing. On my system, the relevant paths for this particular repo were: /var/lib/yum/repos/x86_64/7/artifactory/gpgdir /var/lib/yum/repos/...
cherdt's user avatar
  • 415
5 votes
Accepted

How to reposync saltstack? reposync failing with error message `Removing [...], due to missing GPG key.`

I stumbled upon the answer! It seems, rpm must keep a keystore someplace separate from /etc/pki/rpm-gpg, and it seems insufficient for the gpgkey= line to be specified in the repo file. After doing ...
Edward Ned Harvey's user avatar
5 votes
Accepted

gpg-agent: fatal error in syslog on ssh login

I found the issue. It's actually because I set the home directory to a folder that the user doesn't have permissions over. This caused the system to be unable to create .gnupg in the home folder, ...
John Doe's user avatar
  • 365
5 votes
Accepted

Trust gpg key via script

get fingerprint for key "keyname": FP=$(gpg --list-keys keyname | head -n2 | tail -n1 | tr -d '[:blank:]') trust key: echo -e "5\ny\n" | gpg --command-fd 0 --edit-key "$FP" trust
lonix's user avatar
  • 928
4 votes

gpg-agent says agent exists, but gpg says agent doesn't exist?

The running gpg agent's major version is 2. You should invoke gpg2 rather than gpg as answered here: https://unix.stackexchange.com/questions/231386/how-to-make-gpg-find-gpg-agent
Hermann's user avatar
  • 195
4 votes

gpg --gen-key hangs at gaining enough entropy on centos 6

I've tried all the solutions, and found that haveged works the best even when others don't work (especially on a headless server that doesn't have much user input or activity). yum install haveged ...
wisbucky's user avatar
  • 1,109
4 votes

apt warnings with HP SDR/MCP repo on Ubuntu

To everyone coming here in 2018. Some considerations. HP has separated it's enterprise and home businesses in two companies. HP and HPE. So the url's have changed from downloads.linux.hp.com to ...
helder.tavares.silva's user avatar
4 votes

How do I import a RSA SSH key into GPG as the _primary_ private key?

There can be good reasons to convert a regular PKCS-format key for import into gpg. For example, if you want to put it onto a smart card. The facilities gpg provides with its card-info and card-edit ...
foo's user avatar
  • 150

Only top scored, non community-wiki answers of a minimum length are eligible