date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,679,997,093,000
I have changed to Fedora Linux and shrunk my windows partition. I have unallocated space which I want Fedora to take up. I have looked other answers to questions like this and cannot find instructions for my use case. I have a picture of my drive right now. I also have a live USB ready. From what I have read so far, I...
how do I move the Fedora partition to before the boot ext4 partition and resize it? The answer may be surprising: You don't have to do that. Since you are using LVM and are not aiming to extend a non-LVM partition (i.e. /boot), you don't have to extend the existing PV. Instead, you can make a new partition out of th...
How can I resize my fedora lvm partition to be larger with the root partition in the way?
1,679,997,093,000
Below is the info I get using (g)parted or fdisk command. Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 196265983 196263936 93.6G 83 Linux /dev/sda2 196268030 229468159 33200130 15.9G 5 Extended /dev/sda5 196268032 229468159 33200128 15.9G 82 Linux swap / Solaris ...
This question is not well defined. If the disk is formatted using GPT, then there are no extended partitions, and so there is no heirarchy. If the disk is formatted using MBR in such a way that a Microsoft OS can access it, then there is at most 1 extended partition, and a total of up to 4 primary and extended partiti...
How to check if partition is Extended/Primary in Linux
1,679,997,093,000
This question is very vague, so allow me to be more specific: I divided my USB drive (a temporary storage device until I get an SSD) into 6 partitions using GParted. I planned to use Rufus to install multiple Linux distros (up to 6), but I forgot that it actually identifies the whole USB drive, not individual partitio...
Should I make a partition containing only GRUB? I am still learning the concepts of Linux OSes so I'll be at a slow pace. My main goal is to be able to boot up any OS of Linux I have installed by choosing it in the GRUB or something of the sort. GRUB = Grand Unified Boot Loader yes, it would make sense to partition...
How should I configure my drive to be able to boot from multiple distros of Linux?
1,424,003,876,000
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] was imported gpg: Total number of treated keys: 1 gpg: i...
You need to add --import to the command line to import the private key. (You don't need to use the --allow-secret-key-import flag. According to the man page: "This is an obsolete option and is not used anywhere.") gpg --import private.key
How to import secret gpg key (copied from one machine to another)?
1,424,003,876,000
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?
Export Public Key This command will export an ascii armored version of the public key: gpg --output public.pgp --armor --export username@email Export Secret Key This command will export an ascii armored version of the secret key: gpg --output private.pgp --armor --export-secret-key username@email Security Concerns, B...
How to export a GPG private key and public key to a file
1,424,003,876,000
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 it be signed by the old (I could try to edit the key and change the d...
Private keys never expire. Only public keys do. Otherwise, the world would never notice the expiration as (hopefully) the world never sees the private keys. For the important part, there is only one way, so that saves a discussion about pros and cons. You have to extend the validity of the main key: gpg --edit-key 0x1...
How to renew an expired keypair with gpg
1,424,003,876,000
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 --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA...
Installing the package dirmngr fixed the error. user@debian-server:~$ sudo apt-get install dirmngr Retrying : user@debian-server:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF Executing: /tmp/apt-key-gpghome.haKuPppywi/gpg.1.sh --keyserver hkp://keys...
gpg: keyserver receive failed: No dirmngr
1,424,003,876,000
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 keyserver.ubuntu.com gpg: keyserver timed out gpg: keyserver receive fa...
This is usually caused by your firewall blocking the port 11371. You could unblock the port in your firewall. In case you don't have access to the firewall you could: Force it to use port 80 instead of 11371 $ sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59 -or alternatively omitting the port-...
keyserver timed out when trying to add a GPG public key
1,424,003,876,000
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 these abbreviation in the usage field mean? I can derive that: S -> f...
Ok, the gpg manual does not seem to mention these abbreviations. Thus, one has to look at the source. For example under Debian/Ubuntu: $ apt-get source gnupg2 $ cd gnupg2-2.0.17 $ cscope -bR $ grep 'usage: %' . -r --exclude '*po*' $ vim g10/keyedit.c jump to usage: % jump to definition of `usagestr_from_pk` From the ...
How are the GPG usage flags defined in the key details listing?
1,424,003,876,000
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 failure
Behind a firewall you should use the port 80 instead of the default port 11371 : sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9A2FD067A2E3EF7B Sample output: Executing: /tmp/apt-key-gpghome.mTGQWBR2AG/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 9A2FD067A2E3EF7B gpg: key 9A2FD067A2E...
gpg: keyserver receive failed: Server indicated a failure
1,424,003,876,000
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 created this key before the clean install it read: uid [ ultimate ] User < ...
GNUPG has a trust database stored at ~/.gnupg/trustdb.gpg You can backup this trust database using the --export-ownertrust option: gpg --export-ownertrust > file.txt If you exported your secret keys and import them later into a new environment, the trust database is no longer present. However, this is easily remedied...
gpg —list-keys command outputs uid [ unknown ] after importing private key onto a clean install
1,424,003,876,000
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 BBEBDCB318AD50EC6865090613B00F1FD2C19886 Executing: /tmp/apt-key-gpghome.wRE6z9GBF8/gp...
You usually have a proxy for ftp, http and https; I am seeing there hkp:// as an URL; so it should not be directed via a pure http proxy, hence failing the communication. Use this instead: sudo apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://localhost:3128 --recv-keys BBEBDCB318AD50E...
Unable to add gpg key with apt-key behind a proxy
1,424,003,876,000
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?
You may not be able to do this, at least not yet, or at least not in the general case. However, I will share what I have learned, and look forward to updating this answer in due course. First of all, unlike the ssh-agent capability, which actually caches private keys, gpg-agent can cache either keys or passphrases. It...
How can I find out what keys gpg-agent has cached? (like how ssh-add -l shows you cached ssh keys)
1,424,003,876,000
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 /home/vlastimil/.gnupg drwx------ 4 vlastimil vlastimil 4,0K Jun 26 11...
This is the result of running gpg with sudo: gpg then runs as root, but its home directory is still the user’s. This explains both the warning (gpg is running as root but another user owns the configuration directory) and dirmngr’s socket’s ownership. To fix this up, you should stop dirmngr: sudo gpgconf --kill dirmng...
gpg: WARNING: unsafe ownership on homedir '/home/user/.gnupg'
1,424,003,876,000
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 gpg and gpgsm as well as for a couple of other utilities." Can anybody...
Gpg-agent is a program that runs in the background (a daemon) and stores GPG secret keys in memory. When a GPG process needs the key, it contacts the running gpg-agent program through a socket and requests the key. If the agent process has the key, it provides it to gpg. If it doesn't, it attempts to load the encrypte...
How does GPG agent work?
1,424,003,876,000
I renewed my gpg key pair, but I am still receiving the following error from gpg. gpg: WARNING: Your encryption subkey expires soon. gpg: You may want to change its expiration date too. How can I renew the subkey?
List your keys. $ gpg --list-keys ... ------------------------------- pub rsa2048 2019-09-07 [SC] [expires: 2020-11-15] AF4RGH94ADC84 uid [ultimate] Jill Doe (CX) <[email protected]> sub rsa2048 2019-09-07 [E] [expired: 2019-09-09] pub rsa2048 2019-12-13 [SC] [expires: 2020-11-15] 7DAA371...
How to renew an expired encryption subkey with gpg
1,424,003,876,000
I am trying to install Pass: the standard Unix password manager, however, when I try to add passwords to the appliation I get these errors gpg: Kelly's Passwords: skipped: No public key gpg: [stdin]: encryption failed: No public key GPG Public Keys? When I type in the command gpg --list-keys I get: /home/khays/.gnupg...
How did you create the password store? pass init "Kelly's Passwords"? If so, this is wrong, you should have called pass init 64290B2D. And if then pass insert foo will fail with: gpg: fooo: skipped: public key not found gpg: [stdin]: encryption failed: public key not found then you have to trust your own key first (g...
I try to add passwords to the "pass" password manager. But my attempts fail with "no public key" GPG errors. Why?
1,424,003,876,000
When I run gpg --list-keys I get the following output: /home/yax/.gnupg/pubring.kbx ---------------------------- pub rsa2048 2020-10-09 [SC] 4424C645C99A4C29E540C26AAD7DB850AD9CFFAB uid [ultimate] yaxley peaks <[email protected]> sub rsa2048 2020-10-09 [E] What is my actual key in this block of te...
what is my actual key in this block of text? It's not shown. Since this is, as you (correctly) said, an RSA 2048-bit key, your actual public key (which is what --list-keys shows) in hex would be over 500 characters -- about 7 full lines on a typical terminal. Your private key, which, for historical reasons*, PGP and...
help understanding gpg --list--keys output
1,424,003,876,000
ERROR: type should be string, got "\nhttps://sks-keyservers.net/ (Internet Archive snapshot) says\n\nThis service is deprecated. This means it is no longer maintained, and new HKPS certificates will not be issued. Service reliability should not be expected.\nUpdate 2021-06-21: Due to even more GDPR takedown requests, the DNS records for the pool will no longer be provided at all.\n\nWhich keyservers can I use for gpg --keyserver \"$keyserver1\" --recv-key keyid that I can expect not will go away anytime soon?\n"
I chose to use pgp.surf.nl keyserver.bazon.ru agora.cenditel.gob.ve pgp.benny-baumann.de
sks-keyservers gone. What to use instead?
1,424,003,876,000
I'm trying to fetch some GPG keys over keys.gnupg.net and hkps.pool.sks-keyservers.net and both fails with: gpg: requesting key 1F41B907 from hkps server hkps.pool.sks-keyservers.net gpgkeys: HTTP fetch error 1: unsupported protocol I'm using Debian testing. gpg --version yields gpg (GnuPG) 1.4.16
For some reason or another I need to install the gnupg-curl to get SSL support over HKP: This package contains the keyserver helper tools built with libcurl, which replace the ones in the gnupg package built with the "curl shim" variant of gnupg. This package provides support for HKPS keyservers. Installing it...
I fail to fetch GPG keys over HKPS with "gpgkeys: HTTP fetch error 1: unsupported protocol" error
1,424,003,876,000
The cryptographic signature of an RPM can be verified with the rpm -K command. This returns a string containing gpg (or pgp) and ending in OK if the signature is in RPM's database and is valid. If the package is not signed but the checksums are valid, you'll still get OK, but no gpg. If the package is signed but the k...
rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE} %{SIGPGP:pgpsig} %{SIGGPG:pgpsig}\n'
How do I tell which GPG key an RPM package was signed with?
1,424,003,876,000
I am running Gentoo Hardened with kernel 4.1.7-hardened-r1 and I am trying to encrypt a file using GPG from a shell session opened from SSH and with the DISPLAY variable disabled in order to use pinentry-curses for password prompt. Using gpg -o file.gpg --symmetric file I can encrypt just fine. Using pv file | gpg -o ...
You should set the GPG_TTY environment variable for it to work, as in this document: GPG_TTY=$(tty) export GPG_TTY Those two lines are supposed to be in your ~/.bashrc (assuming bash), so they're run every time you open new terminal session. There's another solution, though: in bash you can run your pv and pretend it...
Gentoo Linux GPG encrypts properly a file passed through parameter but throws "Inappropriate ioctl for device" when reading from standard input
1,424,003,876,000
When I run gpg --with-fingerprints --with-colons keyfile.key, I get a machine parsable output on stdout containing the key fingerprint for the key inside the keyfile (which is exactly what I want), plus the following error on stderr: gpg: WARNING: no command supplied. Trying to guess what you mean ... So GnuPG is gu...
The good folks at the [email protected] mailing list had the answer: For versions >= 2.1.23: cat keyfile.key | gpg --with-colons --import-options show-only --import For versions >= 2.1.13 but < 2.1.23: cat keyfile.key | gpg --with-colons --import-options import-show --dry-run --import
GnuPG command to show key info from file
1,424,003,876,000
I have an OpenPGP smart card key (YubiKey NEO) as well as a local secret key installed in my GnuPG keyring. I'd like to encrypt and sign a file with my card's key, not the key in my keyring. How can I specify what key I'd like to sign with? If my filesystem secret key id is DEADBEEF and my smartcard key is DEADBEE5, ...
You should specify --default-key: gpg -s --default-key DEADBEE5 input > output and check afterwards with gpg -d < output | head -1 From the gpg man page( --sign section): The key to be used for signing is chosen by default or can be set with the --local-user and --default-ke...
Encrypt and sign with specific secret key
1,424,003,876,000
Upon executing apt-key list, I see a key which I wish to remove. ... pub rsa2048 2017-11-24 [SC] 3241 413F 3CE0 B919 E82F DCA0 6239 92CF C9A9 7C2C uid [ unknown] John Doe <[email protected]> sub rsa2048 2017-11-24 [E] ... man apt-key tells me that I may delete a key by executing apt-key del keyid...
The keyid is the last 8 characters of the gpg key's fingerprint, which is that long hex-code under pub In your case it is: sudo apt-key del C9A97C2C Reference: How can I remove gpg key that I added using apt-key add -?
How to identify gpg key IDs so they may be deleted
1,424,003,876,000
Yes, I know it is a step into a lesser secure system, but the current setting makes it reasonable (the key is not important, but the signing has to be automatized). Google results say this: List the keys with a gpg --list-keys Edit the key with a gpg --edit-key C0DEEBED.... A gpg command line console starts, there a ...
With pinentry-0.8.1 (and gnupg2-2.0.22) on Centos 7 I was able to remove the passphrase from the secret key by not specifying a new password; pinentry did whine and warn about the blank password but both the console and GTK pinentry programs had a "Take this one anyway" prompt that resulted in a password-free secret k...
How can I remove the passphrase from a gpg2 private key?
1,424,003,876,000
When I put export GPG_TTY=$(tty) in my .zshrc and restart terminal window and execute echo $GPG_TTY it says not a tty. When I source .zshrc by source ~/.zshrc && echo $GPG_TTY it correctly reports /dev/pts/1. What could be that my .zshrc fails to find tty when its documentation says that .zshrc is used for interacti...
tty command requires that stdin is attached to a terminal. When using Powerlevel10k, stdin is redirected from /dev/null when Instant Prompt is activated and until Zsh is fully initialized. This is explained in more detail in Powerlevel10k FAQ. To solve this problem you can either move export GPG_TTY=$(tty) to the top ...
zshrc export GPG_TTY=$(tty) says not a tty
1,424,003,876,000
I am trying to encrypt a file locally and I get an error. [email protected] is a placeholder for my email address, a public key exists for that in my keyring and also on key servers. My private key is located on a hardware key (Yubikey). I can decrypt previously encrypted files with no problem. Here is the error: ➜ ~...
Extending key expiration date fixed the problem. The error message was misleading. However adding -vv as Jens Erat suggested produced some useful error messages such as gpg: Note: signature key ... expired and gpg: ... skipped: Unusable public key that helped finding the actual error.
gpg: error retrieving '[email protected]' via WKD
1,424,003,876,000
On Fedora 22, gpg doesn't find gpg-agent: % gpg-agent --daemon % gpg -vvv --use-agent --no-tty --decrypt file.gpg gpg: using character set `utf-8' :pubkey enc packet: version 3, algo 1, keyid 3060B8F7271AFBAF data: [4094 bits] gpg: public key is 271AFBAF gpg: using subkey...
Looking at the versions reveals the problem: % gpg-agent --version gpg-agent (GnuPG) 2.1.7 % gpg --version gpg (GnuPG) 1.4.19 The components come from different packages (gnupg2-2.1.7-1.fc22.x86_64 and gnupg-1.4.19-2.fc22.x86_64 in my case). The solution...
How to make gpg find gpg-agent
1,424,003,876,000
AFAIK The basic concept about gpg/pgp is that for two people who want to create trust between them is both publish a public key and private key (the private key is kept with the user who creates it, doesn't share) with strength (1024 bits at one time, 4096 now and 8192 in future and so on and on). Now the two of them...
gpg --keyserver pgp.mit.edu --recv-keys DAD95197 is supposed to import keys matching DAD95197 from the MIT keyserver. However the MIT keyserver often has availability issues so it’s safer to configure another keyserver. I generally use the SKS pools; here are their results when looking for “ashish”. To import the key...
How to import keys from a keyserver using gpg in debian?
1,424,003,876,000
I'm trying to set up OfflineIMAP to authenticate via a gpg encrypted file (that way I can consolidate all my encryption to my gpg-agent process). From the documentation, it seems the only way to encrypt one's server passwords is to use gnome-keyring (which I'd prefer not to run on my headless server). Is there a way t...
Another method of leaving offlineimap running with knowledge of your password, but without putting the password on disk, is to leave offlineimap running in tmux/screen with the autorefresh setting enabled in your ~/.offlineimaprc You need to add autorefresh = 10 to the [Account X] section of the offlineimaprc file, to...
Encrypt OfflineIMAP Password
1,424,003,876,000
Using Debian Jessie and GnuPG 2, each time I try to use GnuPG 2 (gpg2) or gpg-connect-agent together with an OpenPGP smartcard (in my case a YubiKey), the operation fails with a message $ gpg-connect-agent --hex "scd apdu 00 f1 00 00" /bye ERR 67108983 No SmartCard daemon <GPG Agent> $ gpg2 --card-status ERR 67108983 ...
scdaemon is missing GnuPG 2 connects to the card through gpg-agent, which again does not include smart card capabilities, but accesses them through another application. This can be configured and has a system-dependent default, from man gpg-agent: --scdaemon-program filename Use program filename as the Smartcard...
Why do GnuPG 2 and gpg-connect-agent fail with "ERR 67108983 No SmartCard daemon"?
1,424,003,876,000
The very first time that I install a package from epel, I am prompted if I want to import a GPG key. Notice how there are 2 'Is this ok' prompts when installing redis? [root@us-devops-build02 yum.repos.d]# yum install redis Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile .. truncated for rea...
The reason yum is asking for a key is that it is not present in /etc/pki/rpm-gpg ls /etc/pki/rpm-gpg/ | column RPM-GPG-KEY-CentOS-6 RPM-GPG-KEY-CentOS-Security-6 RPM-GPG-KEY-CentOS-Debug-6 RPM-GPG-KEY-CentOS-Testing-6 RPM-GPG-KEY-puppetlabs You can import the key in one of 4 ways: use rpm --import http...
How to automatically accept epel gpg key
1,424,003,876,000
Is it posible to configure gpg in a way that I enter passphrase only once, and it will work for the whole session (I'm using Ubuntu/XFce)? I'm not sure how gpg works, it seems that the default function is that gpg asks gpg-agent for the passphrase and the agent runs pin-entry to ask for passphrase. I would like to us...
You can use the technique described on this page: http://fvue.nl/wiki/Debian_4.0:_Installing_gpg-agent Here's the gist: Install gpg-agent and pinentry program: sudo apt-get install gnupg-agent pinentry-curses Add the lines below to ~/.profile. Any POSIX-confirming shell should include this file. # Invoke GnuPG-Agent...
How to configure gpg to enter passphrase only once per session
1,424,003,876,000
I am tasked with automating a gpg decryption using cron (or any Ubuntu Server compatible job scheduling tool). Since it has to be automated I used --passphrase but it ends up in the shell history so it is visible in the process list. How can I go about automating decryption while maintaining good (preferably great) se...
Store the passphrase in a file which is only readable by the cron job’s user, and use the --passphrase-file option to tell gpg to read the passphrase there. This will ensure that the passphrase isn’t visible in process information in memory. The level of security will be determined by the level of access to the file s...
How can I automate gpg decryption which uses a passphrase while keeping it secret?
1,424,003,876,000
Yesterday, I received signature expired: Err:24 https://repo.skype.com/deb stable InRelease The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]> Today the same problem, solutions? I'm on Linux Mint 20.1.
The solution is pretty simple, Microsoft keeps their updated GPG signing key in this file: https://repo.skype.com/data/SKYPE-GPG-KEY So, one can do for example: curl -s https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add - Note: You should not implicitly trust any key (or file for that matter) and inspect t...
How to update expired Skype signing key
1,424,003,876,000
I am trying to run an update, I get a lot of "Hit"'s and "Ign"'s but in the end I get these errors, does anybody know what they mean and how I can fix them? W: GPG error: http://speglar.simnet.is olivia Release: The following signatures were invalid: BADSIG 3EE67F3D0FF405B2 Clement Lefebvre (Linux Mint Package Reposit...
As Gilles explained, most Linux repositories are signed with GPG encryption keys. apt then uses these keys to ensure the authenticity of the repositories. In order to safely use a repository, you need to add it's keys to the list that apt considers trusted. Each necessary key needs to be downloaded from a key server ...
Invalid signatures when running apt-get update
1,424,003,876,000
I'm writing a script which creates project archives and then creates 7z archives of them to make it easier on me to save specific versions and keep encrypted backups. After I've generated the archives and I get to the encryption phase, I'd like to encrypt the files with one call to gpg if possible, so as to only have ...
Is there a way to pass multiple filenames to gpg to have it encrypt all of them in one go? No, there is not. You will likely want to pass the passphrase with one of the following gpg options (the latter would be most secure choice): --passphrase --passphrase-file --passphrase-fd
Encrypt multiple files at once
1,424,003,876,000
I changed the password for my gpg key. However, beforehand I've built an password store via pass with the same gpg key. Now, whenever I query passwords, I still get asked for my old gpg password. Other applications require the new passphrase. How can I change the passphrase for pass? Do I have to run "init" again?
I had the same issue; @Kusalananda is spot on - pass uses gpg2, which stores the key separately, so you have to change the passphrase for both versions. gpg --edit-key "Your Key" > passwd > save gpg2 --edit-key "Your Key" > passwd > save The name of the key used by pass is stored in ~/.password-store/.gpg-id.
How to change passphrase for pass (password manager)
1,462,301,847,000
I use gpg-agent for managing both PGP e SSH identities. The agent is started with a script like this gpg_agent_env="$XDG_CACHE_HOME/gpg-agent.env" export GPG_TTY="$(tty)" if ! ps -U "$USER" -o ucomm | grep -q gpg-agent; then eval "$({gpg-agent --daemon | tee $gpg_agent_env} 2> /dev/null)" else source "$gpg_a...
As per the upstream bug against openssh, the proper way to this is adding the following to your ~/.ssh/config: Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye" This has worked for me perfectly so far.
How to get pinentry-curses to start on the correct tty?
1,462,301,847,000
I'm trying to patch an issue in puppetlabs-apt to enable the use of key fingerprints as identifiers to ensure that a certain key is present by its 40-digit key fingerprint. I'm having difficulty checking that the key is present and I need a command which will output the following: The 8-digit ID of the key. The 16-di...
apt-key adv will let you directly pass options to GnuPG. So you can do something like this to get parseable outpout: # apt-key adv --list-public-keys --with-fingerprint --with-colons ⋮ fpr:::::::::126C0D24BD8A2942CC7DF8AC7638D0442B90D010: pub:-:4096:1:9D6D8F6BC857C906:2014-11-21:2022-11-19::-:Debian Security Archive ...
Get apt's key ids and fingerprints in machine-readable format
1,462,301,847,000
I have installed gpg version 2.2.17 from source. When I run gpg --card-status gpg reports: gpg: WARNING: server 'gpg-agent' is older than us (2.2.4 < 2.2.17). gpg: Note: Outdated servers may lack important security fixes. gpg: Note: Use the command "gpgconf --kill all" to restart them. I have tried running the gpgc...
Thanks to Kusalananda for helping me find my problem. The issue was that gpg-agent was still installed through apt. Running sudo apt remove gpg-agent followed by gpgconf --kill all fixed the issue.
"gpg-agent is older than us" warning message even after running gpgconf --kill all [closed]
1,462,301,847,000
I have a file secret.asc containing an ASCII-armored (i.e., plain text and starts with -----BEGIN PGP PRIVATE KEY BLOCK-----) PGP/GPG secret/private key, and I would like to know its 40-character key fingerprint without importing it into my GPG keyring. Unfortunately, not a single command I've tried has surrendered t...
As indicated in the comments, the simplest solution appears to be to first dearmor the key and then run --list-secret-keys on the new file: $ gpg --dearmor secret.asc # Creates secret.asc.gpg $ gpg --with-fingerprint --no-default-keyring --secret-keyring ./secret.asc.gpg --list-secret-keys Annoyingly, although the d...
How do I get the fingerprint of an ASCII-armored PGP secret key with gpg?
1,462,301,847,000
1) How do I know which servers are used to search for keys with gpg gpg --search-key <keyword> 2) How to add a server to the list of queried server?
“Reputable” key servers exchange key updates with others, so using one is the same as using another (with slight delays in some cases). In the past, the recommendation was to use the SKS server pool, ideally using a secure connection; see the previous link for details, or this answer. However the pool has been disable...
GPG key server for key search?
1,462,301,847,000
One can import a key with: rpm --import /path/to/key But how can you tell later if you have already imported this key? Trying to reimport it will fail with an error and I am trying to avoid this as I am using Puppet to install the key.
You can double check if a key is already imported using rpm -qi gpg-pubkey-<version>-<release>. If it is installed, rpm will give you all the information about it, if not, it'll just exit with a return value of 1, so you could add to your puppet recipe an unless parameter: exec { "rpm --import /path/to/package": # ....
How can I verify that a PGP key is imported into RPM?
1,462,301,847,000
When I tried to upgrade a Fedora 26 Server earlier today, I got this error message after downloading packages: warning: /var/cache/dnf/forensics-5e8452ee3a114fbe/packages/protobuf-c-1.3.0-1.fc26.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 87e360b8: NOKEY Importing GPG key 0x87E360B8: Userid : "CERT Forensics ...
But... you are saying "No": Is this ok [y/N]: n ...when asked to install the key! Try with yes (y) instead!
Error: GPG check FAILED when upgrading system using dnf in Fedora
1,462,301,847,000
I need to encrypt a large file using gpg. Is it possible to show a progress bar like when using the pv command?
progress can do this for you — not quite a progress bar, but it will show progress (as a percentage) and the current file being processed (when multiple files are processed): gpg ... & progress -mp $!
How to show progress with GPG for large files?
1,462,301,847,000
From what little I know, in openpgp you have a private key which you keep locked or hidden somewhere and a public key which you can freely share with anybody. Now I have seen many people attaching .asc file. If I click on that, it reveals the other person's public key. Is having an .asc file nothing but using the pu...
Usually, a .asc file is an ASCII-armored representation of key material (or a signature). Your shirish-public-key.txt looks like it’s just that, so if you’re sure it contains the right information you could simply rename it, as you suggest. (I doubt it contains your public key though — that should start with -----BEGI...
How do you generate an .asc file from pgp public key?
1,462,301,847,000
I have my public key published on keyservers and now I'm on a new computer and I want to import it using the gpg command line tool. I know I can download the public key and import it using gpg --import public.key.file, however I want to know whether one can do it directly in command line using the email address. If th...
GnuPG has the --search, --recv-keys and --send-keys commands for interaction with key servers. OpenPGP key servers don't validate anything, they just distribute keys. This means, anyone can upload keys with arbitrary user IDs -- just search the key server network for [email protected] -- I woulnd't expect any of those...
How to find and add a public key to my gpg keyring from command line using email address?
1,462,301,847,000
I went on to download an application today. It had it's instructions listed, step by step, number one being: adding a GPG-key with apt-key. It was followed by adding the application to apt/sources and finally downloading it with apt-get install. I can't get my head around the need of adding a key, before downloading a...
Why do I need to add a GPG-key with apt-key before adding a download URL to apt/sources and downloading-installing with apt-get install? The reason is simple: security. First, if you don't do this, apt-get update will whine that some keys aren't found, and it downloaded "untrusted" package lists. If you do apt-get i...
Why do I need to add a GPG-key with apt-key before adding URL to sources.list and download-installing an application with apt-get?
1,462,301,847,000
I'm attempting to consolidate my encryption software to GnuPG, and I'm running into a confusing problem. My primary unit is a headless server, and I exclusively work in tmux. There is no X session, and therefore I've configured gpg-agent to use pinentry-curses. I've configured gpg-agent to be called on login with ssh-...
Turns out this one was incredibly simple. Instead of using that script, I simply removed the "--agents" option from my old keychain launch script (guide here). This causes the Keychain program to seek out both ssh-agent AND gpg-agent files. Now my encryption system does work quite seamlessly, even while relying on bot...
Best Practices for SSH, tmux & GnuPG Agent
1,462,301,847,000
I need a bash script to source a file that is encrypted, as the file being sourced contains sensitive information. I would like the script to prompt for the GPG passphrase and then run, sourcing the encrypted file. I cannot figure out how to do this though. There must be user input for the passphrase, as I don't want ...
You can do this using process substitution. . <(gpg -qd "$encrypted_filename") Here's an example: % cat > to-source <<< 'echo "Hello"' % . ./to-source Hello % gpg -e -r [email protected] to-source % . <(gpg -qd to-source.gpg) Hello gpg -d does not persist the file to disk, it just outputs it to ...
Is there a way to source an encrypted (GPG) file on-the-fly in a script?
1,462,301,847,000
I'm installing a piece of software for which I had to use a third-party repository. After adding the repository with rpm -Uvh http://[site], I installed with yum install [package]. One of the prompts that came up during installation read: Importing GPG key 0xABCABCAB "Fname Lname <[email protected]>" from /etc/pki/r...
It's stored in the rpmdb, with the name of gpg-pubkey and the version as the first 8 hexadecimal characters of the fingerprint.
When importing a key during a yum installation, where is that key stored?
1,462,301,847,000
I recently generated two new subkeys to put on an external key card. I previously had a master key (usage marked SC) and a single subkey (marked E). This arrangement was worked fine for what I needed in keeping a few local files private. Just now I created two new subkeys using addkey, one signing key and one encrypti...
To use specific subkeys, and not have GnuPG to resolve the subkey to a primary key, attach ! to the key. For example, to encrypt for the subkey DEADBEEF, use --recipient DEADBEEF!. Important note: using short key IDs is not recommended due to collision attacks, instead use long key IDs or fingerprints.
How can I encrypt with my previous GPG subkey after creating a new one?
1,462,301,847,000
I can't decrypt my passwords with pass neither with gpg directly. gpg: encrypted with rsa4096 key, ID id, created creation_date "name <email>" gpg: public key decryption failed: No pinentry gpg: decryption failed: No pinentry It does not show a prompt dialog asking for the master password. It says "...
I solved the problem by running the following commands pkill gpg-agent gpg-agent --pinentry-program=/usr/bin/pinentry-gtk-2 --daemon and it worked. I don't know why pinentry wasn't working, but starting a new gpg-agent daemon has worked.
GPG can't decrypt: no pinentry program
1,462,301,847,000
Is there any way to encrypt a directory using gpg? It seems to only accept files as arguments.
Why not tar the files to be encrypted and then encrypt the tarball?
Encrypt directory with GnuPG?
1,462,301,847,000
So I created a gpg encrypted file with password: gpg -c passwords.txt.gpg how can I open it with vi, edit it, then close it? (So that no passwords.txt file will be created, the decrypted passwords.txt is only in the memory! - better: after closing the passwords.txt.gpg file, the memory should be cleaned, so it shoul...
Original Answer The gnupg plugin for Vim does this: This script implements transparent editing of gpg encrypted files. The filename must have a ".gpg", ".pgp" or ".asc" suffix. When opening such a file the content is decrypted, when opening a new file the script will ask for the recipients of the encrypted file...
How to edit a .gpg file with vi?
1,462,301,847,000
The following warning message appears during my apt-get update && apt-get upgrade procedure on Linux Mint 21: W: https://repo.skype.com/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. I searched through the Micros...
Without this being finally resolved by Microsoft, let this answer serve only as a workaround. Maybe these commands could be chained or something, anyway... my procedure was: Exporting the public key from the now-considered deprecated keyring: apt-key export "D404 0146 BE39 7250 9FD5 7FC7 1F30 45A5 DF75 87C3" > skyp...
repo.skype.com/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION
1,462,301,847,000
I was installing Manjaro GNOME 18.0.4 for my sister. However, when I tried to update all packages using pacman -Syu, the update fails due to two signature errors: dunst package with signature by "Matti Hyttinen <[email protected]>" notification-daemon with signature by "Brett Cornwall <[email protected]>" Interestin...
Solution: open /etc/pacman.conf change all SigLevel entries to Never (comment the old ones out) pacman -Syu change /etc/pacman.conf back rm -r /etc/pacman.d/gnupg pacman-key --init pacman-key --populate archlinux manjaro pacman-key --refresh-keys
Manjaro Update fails: signature is unknown trust
1,462,301,847,000
In the following video: Linux HOWTO: Secure Your Data with PGP, Part 2, you are shown how to create a key pair with gpg. At about 1:50, the instructor says the following: While the key is being generated, it is a good idea to move your mouse around a little bit to give it a bit more random number entropy for the crea...
There is a grain of truth to this, in fact more truth than myth, but nonetheless the statement reflects a fundamental misunderstanding of what's going on. Yes, moving the mouse while generating a key with GPG can be a good idea. Yes, moving the mouse contributes some entropy that makes random numbers random. No, movin...
Adding "random number entropy" for GPG keys?
1,462,301,847,000
Suppose one deleted (or damaged) the following file. /etc/apt/trustdb.gpg How to regenerate it?
I found these 2 methods for doing it. The first seems like the safest way to do it. Method #1 - using apt $ sudo -i $ apt-get clean $ cd /var/lib/apt $ mv lists lists.old $ mkdir -p lists/partial $ apt-get clean $ apt-get update Method #2 - apt-key You can use this command to get apt-key to generate the corresponding...
How to regenerate /etc/apt/trustdb.gpg on Debian?
1,462,301,847,000
The key currently has an unknown validity: $ gpg --edit-key some.user pub rsa4096/FAC6C35BDFF9359A created: 2020-03-01 expires: 2022-03-01 usage: SC trust: full validity: unknown sub rsa4096/CDA6BEA851FFCE2E created: 2020-03-01 expires: 2022-03-01 usage: E [ unknown] (1). Some User ...
Unknown validity means that GnuPG hasn’t calculated the web of trust for that key, and therefore it doesn’t know whether the key is valid or not. This is always the case for newly-added keys, but it can also happen for updated keys (since changes in signatures can affect your connection to the key). Trust recalculatio...
Unknown validity despite having signed the key myself
1,462,301,847,000
I have a script that basically needs to do the following: #!/bin/bash GPG_PUBLIC_KEY=<<EOF -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.12 (GNU/Linux) ... -----END PGP PUBLIC KEY BLOCK----- EOF gpg --encrypt --with-public-key "$GPG_PUBLIC_KEY" myfile.txt Is there a way to do this without importing the ...
If you don't want to use the user's keyring at all, point GPG to a temporary keyring. tmp= trap 'rm -rf "$tmp"' EXIT INT TERM HUP tmp=$(mktemp -d) export GNUPGHOME="$tmp" gpg --import <<EOF … EOF gpg -e -r … myfile.txt If you want to use the user's keyring as well, set GNUPGHOME only during the import command and pas...
Is there a way to embed a GPG public key in a script without adding it to the keyring?
1,462,301,847,000
I want to generate a QR code of my 4096-bit armored GPG private key. The key is so big, the program qrencode seems to fail because of its size. $ gpg --export-secret-keys --armor > ~/private.key $ ./qrencode -o test.png < ~/private.key Result: Failed to encode the input data: Numerical result out of range How can I...
Your error message already gives a hint as to what's wrong! Your one-liner is providing the actual file content as filename to the qrencode program. Hence the error message. Try qrencode -o test.png -t png < private.key. You should take a look at shell input-output redirection. For example, I/O Redirection. I see tha...
Generating QR code of very big file?
1,462,301,847,000
Trying to create GPG keys which will be used for an apt repository hosted on my Centos7 box. I created a new user "apt", and then tried to create the keys, but at the very end, it states that I need a pass phrase, but then instantly closes stating cancelled by user. No it wasn't! I have since successfully repeated t...
As to the "cancelled by user" error: GnuPG tries to make sure it's reading the passphrase directly from the terminal, not (e.g.) piped from stdin. To do so, it tries to open the tty directly. Unfortunately, file permissions get in the way — the tty device is owned by the user you log in as. So only that user and root ...
gpg: cancelled by user
1,462,301,847,000
If you call GPG without input, it just says gpg: Go ahead and type your message ... You can enter text and everything, but how do you end the input? I've seen something like this in multiple different programs, but I've never known how.
You need to input EOF (End Of File). Do this with CTRL+D (or more generally, ^D).
Finish entering text in GPG
1,462,301,847,000
I just generated a new GPG key pair and gpg displays some random plus, minus, greater than, less than and circumflex signs. I was always wondering what they mean. Can you explain it to me? iblue@nerdpol:~$ gpg --gen-key [... snip ...] We need to generate a lot of random bytes. It is a good idea to perform some other ...
These are progress indications from the key generation process. Since key generation can be slow, you get a bit of an animated display. The details of the display are pretty obscure and not useful except (a little) for debugging some very specific part of GPG. You're seeing an El Gamal key pair generation. GPG needs t...
GPG key pair generation: What do the plus and minus signs mean?
1,462,301,847,000
I am trying to install spotify using yay on Arch linux. But when I run yay -S spotify this happens: john@arch-thinkpad ~> yay -S spotify :: There are 5 providers available for spotify: :: Repository AUR 1) spotify 2) spotify-dev 3) spotify-legacy 4) spotify094 5) spotio Enter a number (default=1): 1 :: Checking f...
It was solved by manually adding gpg key by this command: gpg --keyserver keyserver.ubuntu.com --recv-key <key name> and running installation again: yay -S spotify
yay error: gpg: keyserver receive failed: No name
1,462,301,847,000
I would like to refresh the UIDs and postpone the expiration date but I get. gpg --edit-key [email protected] gpg (GnuPG) 2.1.15; Copyright (C) 2016 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is av...
I was using an offline master key and used subkeys for signing and decryption. This was displayed by the # in front of my master key. This is why the only operations I could not perform were key signing operations.
GPG --edit-key fails with "no secret key" even though --list-secret-keys and --sign work as expected
1,462,301,847,000
Releases of gnupg from 2.1.16 (currently 2.1.17) block waiting for entropy only on first invocation. Note: this isn't an attempt to generate a key, just to decrypt a file and start the agent. The first time gpg-agent is started, either directly with gpg2 file.gpg or using an application like pass, pinentry appears and...
I think I know what's going on. In gnupg's agent/gpg-agent.c, this function processes messages from libgcrypt. /* This is our callback function for gcrypt progress messages. It is set once at startup and dispatches progress messages to the corresponding threads of the agent. */ static void agent_libgcrypt_pro...
gnupg 2.1.16 blocks waiting for entropy
1,462,301,847,000
Whenever I try to create a signed git commit, I need to enter my GPG key. It spawns some GUI application to receive the password. It looked like the application was seahorse, so I uninstalled it, but git still uses some GUI app. Polybar doesn't report the application name and it's title is just [process]@MYPC. How do ...
What's in your ~/.gnupg/gpg-agent.conf? I have pinentry-program /usr/bin/pinentry-curses in mine, and everything which uses gpg will ask for my pass-phrase in the terminal. NOTE: You will need to restart your gpg-agent (or send it a HUP signal) if you change its config. Just running gpgconf --kill gpg-agent will do, ...
How do I get git to use the cli rather than some GUI application when asking for GPG password?
1,462,301,847,000
gpg has an option --armor, which can generate output in an ASCII-armored format similar to uuencoded documents. It also has an option --clearsign which causes the document to be wrapped in an ASCII-armored signature. How are they different? Can one be done alternatively in terms of the other? Thanks. $ cat sleep.py #...
--armor is an output modifier: you use it in addition to other arguments which specify the operation you want gpg to perform, and it changes the output to be an ASCII-armored file instead of a binary file. Thus gpg --armor --sign myfile will sign myfile and output the signed file in myfile.asc, but none of the conten...
gpg: --armor vs --clearsign
1,462,301,847,000
On a Debian Jessie system: $ ls -al ~/.gnupg/ total 58684 drwx------ 2 username username 4096 Nov 28 20:52 . drwxr-xr-x 50 username username 4096 Nov 28 19:33 .. -rw------- 1 username username 9602 Jun 24 22:47 gpg.conf -rw-r--r-- 1 username username 18 Jun 25 21:07 .#lk0xb7f2fa50.hostname.5551 -r...
They are (as the "lk" suggests) lock files. A comment in the gnupg sources says This function creates a lock file in the same directory as FILE_TO_LOCK using that name and a suffix of ".lock". Note that on POSIX systems a temporary file ".#lk..pid[.threadid] is used. and also states that there is a cleanup f...
Files starting with .#lk0xb in ~/.gnupg directory - what are they?
1,462,301,847,000
I'm trying to hide the "output" of a gnupg command, but it seems that it is always printed. the command is: echo "thisprogramwørks" | gpg -q --status-fd 1 --no-use-agent --sign --local-user D30BDF86 --passphrase-fd 0 --output /dev/null It is a command to verify the password of pgp keys, and by using it like this: a=$...
The "problem" is, that gpg writes directly to the TTY instead of STDOUT or STDERR. That means it cannot be redirected. You can either use the --batch option as daniel suggested, but as a more general approach you can use the script tool, which fakes a TTY. Any output is then sent to STDOUT, so you can redirect it to /...
Silent GnuPG password request with bash commands
1,424,264,793,000
Basically, I have an email account I can access as POP3 or IMAP. I want to take all incoming emails, encrypt them, and then forward the encrypted version to my gmail account (so I can see the subject/notifications on my phone/gmail account; and possibly decrypt the message with a passphrase -- though this last step d...
I just saw the other response and guess I never wrote up the solution I actually implemented. It turns out that python imaplib is straightforward and I wrote a very quick script. Barring a few changes (e.g., anonymizing my various USERNAMEs, EMAILPASSWORD, WORKDOMAINNAME, MYGPGKEYID). I also don't just send encrypt...
Receive Pop/IMAP email and then forward as encrypted to gmail
1,424,264,793,000
I have data like this: -----BEGIN PRIVATE KEY----- MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDPzCORz9kUh4yt 73fiG1amQ16jwjXNzNO0d4xUWlrCP3dTfXnvtF35r2N/5Nefw9CcztBUAZACbwtn (... just sample data ...) jSYDRr88RZI4QYv9pW0+A8vWS2SJnIPW0fP9mcPOdZXxG/V2rL03YV5xcLCdbuBu 1tunEWZ5VcjfyEDfP7qZdWjGIYselOg= -----END PRIV...
Although underlying crypto primitives are similar, PGP file (packet) formats including keys are very different from those used by OpenSSL (mostly ASN.1 and PEM). You don't say so, but this appears to be an RSA key. If Java is okay for you, it can do that using BCPROV plus BCPKIX (for PEM) and BCPG (for PGP) from htt...
How can I import a key in PEM format (not OpenPGP) into GPG?
1,424,264,793,000
gpg -ca passwords.txt create encrypted ASCII file passwords.txt.asc. Emacs open the file as a normal text file: -----BEGIN PGP MESSAGE----- Version: GnuPG v2.0.19 (GNU/Linux) jA0EAwMCkIp3+bQkLWJgyTQYLGVN8EUEG0BE42sEj/8PrnSzgviSiENxtK+/2n73 WXD7EtndVS/MX4lFJ96h8VozChUA =zSwh -----END PGP MESSAGE----- How do I make Em...
I did following to let Emacs open .asc files in the same way of .gpg files (require 'epa-file) (epa-file-enable) (setq epa-file-name-regexp "\\.\\(gpg\\|asc\\)$") (epa-file-name-regexp-update)
How to use Emacs to recognize and automatically open GPG encrypted file in ASCII armored format?
1,424,264,793,000
Context I would like to use GPG authentication subkeys instead of SSH keys. I would also like to use gpg-agent to manage password caching for these keys. I am running in a headless environment, so I would like to use pinentry-curses for my password entry program, but I am fine with anything that works in a headless en...
The problem is that you are calling gpg-connect-agent updatestartuptty every time you open a terminal, so pinentry points itself to the latest shell. What you actually want is not the latest shell terminal, but the one you are connecting from (when calling ssh) For that the easiest way is telling .ssh/config to execut...
What is the proper configuration for gpg, ssh, and gpg-agent to use GPG auth subkeys for SSH with pinentry in a multi-session tmux environment?
1,424,264,793,000
Notice: the very same vulnerability has been discussed in this question, but the different setting of the problem (in my case I don't need to store the passphrase) allows for a different solution (i.e. using file descriptors instead of saving the passphrase in a file, see ilkkachu's answer). Suppose I have a symmetric...
gpg --passphrase $my_passphrase My question: is this safe? Will the variable $my_passphrase and/or the decrypted output be visible/accessible in some way? No, that's not really considered safe. The passphrase will be visible in the output of ps, just like all other running processes' command lines. The data itself...
Security of bash script involving gpg symmetric encryption
1,424,264,793,000
I'm trying to copy my gpg related files over from an old machine to a new one. I've worked out how to copy the keys over: How to import secret gpg key (copied from one machine to another)? but this leaves me with gpg complaining that it doesn't trust the imported keys. How do I transfer the trust db from one machine t...
You can copy ~/.gnupg/trustdb.gpg from one machine to another. You can also export the ownertrust values (which are the ones that matter) and import them on the new machine: gpg --export-ownertrust > otrust.txt rm ~/.gnupg/trustdb.gpg gpg --import-ownertrust < otrust.txt See the gpg manpage for details (although the...
How to migrate GPG trust database from one machine to another?
1,424,264,793,000
I have some public keys of multiple users in my keyring in GnuPG. One of these users has switched to a new public key. I still have the user's old key which has an assigned trust of ultimate. I just assigned the same trust to his new key. He does not use the old key anymore. What should I do with the old key? Should I...
First of all, ultimate trust shouldn't be used for other's keys, full trust is enough. If you issued ultimate trust to make the key itself valid, you missunderstood the web of trust concept. If you just wanted all his certifications to be valid for you (thus, extending your web of trust), full trust is enough, if you ...
What to do when a user switches to a new key?
1,424,264,793,000
I have a Yubikey 4 and I want to use my GPG keys stored on this to authenticate to SSH servers.I want to use GitHub for a start. I have already added my GPG authentication key to GitHub. My problem is that when I ssh, my agent doesn't use this key. I've checked by trying to connect to my VPS with ssh -v but it skips m...
ssh can't open connection to your gpg-agent if you will not give it the way to do so. When you start your gpg-agent with --enable-ssh-support option, it prints out environmental variables that needs to be available in the shell where from you will be using your ssh. There are few possibilities how to get them: Stop y...
gpg-agent instead of ssh-agent
1,424,264,793,000
Debian Jessie, XFCE 4.10, KeePass2, IceDove (with Enigmail).. I'm using KeePass2 generated passwords for my gpg private key, to de/encrypt mails. Icedove is my client which uses the enigmail. As soon as I want to de/encrypt a mail pinentry (pinentry-gtk2) pops up and I can't paste into the password field, nor can I mo...
In Keepass2, "Add Entry," and set "Title" to "GPG." Move from "Entry" tab to "Auto-Type" tab. Select "Override default sequence" and set to "{PASSWORD}". Before you send email, open Keepass2 with Keepass2 password. Ask IceDove with Enigmail to "Send" and pinentry should appear (locking keyboard, preventing "Ctrl+V" (o...
Usage of pinentry with keepass2 for gpg mail encryption
1,424,264,793,000
In gpg's man page, there are examples of key IDs : 234567C4 0F34E556E 01347A56A 0xAB123456 234AABBCC34567C4 0F323456784E56EAB 01AB3FED1347A5612 0x234AABBCC34567C4 and fingerprints : 1234343434343434C434343434343434 123434343434343C3434343434343734349A3434 0E12343434343434343434EAB3484343434343434 0xE1234343434343434...
NOTE: Before I begin, all the representations here are hexidecimal only. There isn't any other representation. Key IDs The man page seems pretty clear on where these values are coming from. The key IDs are a portion of the SHA-1 fingerprint. The key Id of an X.509 certificate are the low 64 bits of its SHA-1 finger...
GnuPG : representations of key IDs and fingerprints
1,424,264,793,000
When you --gen-key in GPG, you can choose which actions of Sign, Certify, Encrypt, and Authenticate the key will be usable for. Can these be later modified (i.e. obviously a new key can be created if the current one has C, and the old one revoked, but that's not the question) to remove or add actions?
Keys' allowed usages can be modified, but the gpg tool doesn't support it (even in version 2). To change a key's usage, you need to modify gpg. The basic idea is detailed in a thread on the gnupg-users mailing list: usage information is carried by the self-signature, so you need to change the usage parser to force the...
Change a key's allowed actions in GPG?
1,424,264,793,000
I've just upgraded readline to a new major release: $ grep readline.*7 /var/log/pacman.log [2016-11-15 21:53] [ALPM] upgraded readline (6.3.008-4 -> 7.0-1) Since this GNUPG is broken: $ gpg gpg: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory That a...
This has been reported to Arch here. The workaround is to run mkinitcpio -P after the upgrade has completed, but before rebooting. If you've rebooted before re-running mkinitcpio, then you'll need to boot off e.g. a USB key and run the mkinitcpio from the chroot. The easiest is to use arch-chroot as in the Arch ins...
gnupg on Arch Linux broken since readline upgrade - can't find libreadline.so.6
1,424,264,793,000
In order to compile a new kernel on my Debian jessie, I am trying to verify the GPG key , following the instruction on the official website. I have download the the linux-3.18.35.tar.sign and linux-3.18.35.tar.xz version and unzip it using unzx. To verify the .tar archive using the command : gpg --verify linux-3.18.35...
You only need to have the public key in your keyring: gpg --keyserver subkeys.pgp.net --recv-keys 0x38DBBDC86092693E (use the long identifier!). If it times out, try again — there are multiple servers, and some of them seem to be having issues currently. apt-key etc. aren't involved in this at all. Once you have the ...
Unable to verify the kernel signature "gpg: Can't check signature: public key not found"
1,424,264,793,000
I would like to query gpg to list only the keys that I own on my local keyring. How is this done? I can see all keys by doing gpg list-keys -- that shows all the keys. I want just my keys.
Assuming you have private keys on your machine only for your keys, you could do with listing private keys with gpg --list-secret-key This will show you only keys that have a private counterparts. Otherwise, you can list either all or single key.
how can I get gpg to list only my keys?
1,424,264,793,000
I recently got a Yubikey and loaded keys onto it following the directions here. gpg successfully reads and writes to the card, and I can see the key fingerprints from it it. However, when I try to use gpg --edit-card then fetch to get the key stubs, nothing happens. There is no error, but also my keys do not appear. W...
GPG Smart Card Mini-How-To Short Answer It seems the secret keys are properly copied to the Yubikey smart card. However, the public key is missing from the local keyring. In order for gpg to work properly, the public key must be available locally. There are several methods to import the public key. However, there i...
Why does gpg fail to fetch key stubs from my smart card?
1,424,264,793,000
I have a .tar.xz file which I would like to detach-sign using my gpg private key. The problem is, I have multiple of private keys imported to my keyring and need to choose, which one to use. Progress This I am trying to execute: gpg --output somefile.tar.xz.sig --detach-sig somefile.tar.xz --local-user [fingerprint] ...
Solution I have been to remedy the situation using the following working example: gpg --local-user [fingerprint] --sign --armor --output somefile.tar.xz.asc --detach-sig somefile.tar.xz Parsing gpg: the program doing the signing; in my case version 2.2.4 --local-user: takes an ID as an argument or a fingerprint in m...
How to detach-sign a file with a specific private key? || Why this fails?
1,424,264,793,000
I want to import my old gpg2 secret keyring from a backup. I only have my old .gnupg directory. But all files in this folder are unrecognized by gpg2, which says "No valid OpenPGP data found" when I try to --import them. How can I import my old secret keys ?
Solved it by replacing my new .gnupg directory by the old one, exporting the keys in an importable format, then restoring my new .gnupg and importing the keys : mv ~/.gnupg ~/.new_gnupg cp -r old_backup/.gnupg ~ gpg2 --export-secret-keys > sec.gpg rm -r ~/.gnupg mv ~/.new_gnupg ~/.gnupg gpg2 --import sec.gpg
gpg2 won't import .key files : No valid OpenPGP data found
1,424,264,793,000
I am using Arch Linux and trying to build a package from the AUR. In order to build this package I need to download source files from a repository. The Arch PKGBUILD lists a key as a validpgpkey. While I can download this key individually, it is also possible to configure GPG to auto retrieve the key with keyserver-op...
The package build process itself is safe, even with automatic key retrieval: since validpgpkeys must list full fingerprints, the key that’s automatically retrieved is sure to be the correct one. The main use-case that’s affected by automatic key retrieval is detecting unwanted changes to the validpgpkeys declaration (...
Safety of using auto-key-retrieve with GPG
1,424,264,793,000
Is it possible to set up SSH (via pam for instance) to check the public key of the connecting client against a CA server? I've tried with gnupg (via gpg-agent --daemon --enable-ssh-support) and also tried working with OpenCA which proved to be a challenge just to install. Also, the documentation is horrific when it co...
I know this is a very old question. However, there are two answers to your question. Getting GPG working with SSH. You've done the first step, enabling-ssh-support in your gpg-agent.conf But, you haven't supplied any PGP keys to use. In order to use PGP keys with ssh, you've got to export the public key in ssh form...
SSH + Certificate Authority server?
1,424,264,793,000
I want to encrypt a file with a private key and decrypt it with a public key. A public key will be embedded in my app. So I want to have a guarantee that the file was created by me. How can I use gpg or openssl to implement it.
It makes no sense to encrypt a file with a private key. Using a private key to attach a tag to a file that guarantees that the file was provided by the holder of the private key is called signing, and the tag is called a signature. There is one popular cryptosystem (textbook RSA) where a simplified (insecure) algorith...
How to encrypt a file with private key
1,481,718,407,000
I want to create a script that would automatically encrypt and push to GitHub into public repo some sensible files I don't want to expose (but do want to keep together with the whole project). As a solution I decided to encrypt them with GPG. The issue is that I can't find any clues on how to encrypt a particular fil...
Use one of the --passphrase-... options, in batch mode: --passphrase-fd reads the passphrase from the given file descriptor echo mysuperpassphrase | gpg --batch -c --passphrase-fd 0 file --passphrase-file reads the passphrase from the given file echo mysuperpassphrase > passphrase gpg --batch -c --passphrase-...
Encrypt with GPG using a key passed as CLI argument
1,481,718,407,000
I'm trying to change the passphrase of my GPG's secret key. I actually changed it using seahorse (Also tried gpg --edit-keys and passwd, but when I tried to export my private key it asks me for two passphrase now (Both new and old one) and uses the old one for sub secret key. Now I have to remember two complicated pa...
For GPG 2.1 and later, the private keys are stored in ~/.gnupg/private-keys-v1.d Each key, including subkeys, are stored as separate files using the keygrip of the key as the filename: <keygrip>.key When using gpg --edit-key to change the passphrase, all subkeys are modified in the private key directory. However, it ...
How to correctly change the passphrase of GPG's secret key?
1,481,718,407,000
I've been asked to distribute electronic certificates (they were originally paper), in a PDF format, but I'd like to sign them with gpg or something similar so users can upload them to my site to check that they've not been handed a fake copy. So, I'd like to sign a PDF file (transparently, the user doesn't need to kn...
You can do it with a separate signature file. Sign the Document: % gpg --output doc.pdf.sig --detach-sig doc.pdf Distribute doc.pdf and doc.pdf.sig Verify the Document: % gpg --verify doc.pdf.sig doc.pdf
Sign a PDF file to verify integrity and validity
1,481,718,407,000
I have a lot of files encrypted with gpg. All files have the same password. Is it possible to use xargs to decrypt files? ls | xargs -n 1 gpg asks for the password for every file.
Run gpg-agent or a similar program. Set up gpg to look for a running agent, as explained in the documentation. Enter the passphrase in the agent once and for all (for this session). Note that ls | xargs -n 1 gpg only works if your file names do not contain any special characters. Generally speaking, don't parse the ou...
Decrypt files encrypted with gpg using xargs
1,481,718,407,000
when using gpg with gpg-agent, following sockets are created in my ~/.gnupg directory: S.gpg-agent S.gpg-agent.browser S.gpg-agent.extra S.gpg-agent.ssh I assume, S.gpg-agent is the standard gpg-agent socket. But what are the others for? I am not using gpg with ssh, or gpg with browser. Where is it configured, that t...
The gpg-agent can have multiple personalities and deliver different services. For example, you can stop having ssh-agent running on your box, and use gpg-agent as a drop in replacement... as long as you use the proper socket, S.gpg-agent.ssh because it has to implement the proper protocol ssh is expecting to discuss. ...
why does gpg-agent create several sockets
1,481,718,407,000
I am trying to setup automatic signing of git commits with gpg. I have a private/public key pair, that I use to authenticate to the server and be able to push commits. I would like to use the same key for signing commits (because someone could authenticate as themselves, but push a commit with my name on it). Is that ...
Yes, you can auto-sign commits by setting the commit.gpgsign option. However, you need a PGP-type key, not an SSH key. What you can do is use gpg-agent as an ssh agent.
Use my ssh key to sign git commits