Difference between revisions of "Gpg"

From Bashlinux
Jump to: navigation, search
Line 11: Line 11:
 
# gpg --keyserver my.domain.com --send-keys ABCDE123
 
# gpg --keyserver my.domain.com --send-keys ABCDE123
   
=== How to import a repository key from the key server (Ubuntu) ===
+
=== How to import a repository key ===
  +
* From a key server
 
# gpg --keyserver keyserver.ubuntu.com --recv-key F0DAA5410C667A3E
 
# gpg --keyserver keyserver.ubuntu.com --recv-key F0DAA5410C667A3E
 
# gpg -a --export F0DAA5410C667A3E | apt-key add -
 
# gpg -a --export F0DAA5410C667A3E | apt-key add -
# apt-get update
+
# apt-key update
   
  +
* From a file
=== How to import a repository ke from a file (CentOS) ===
 
  +
:* '''Ubuntu'''
  +
apt-key add my.domain.com
  +
:* '''Fedora/CentOS'''
 
# rpm --import my.domain.com
 
# rpm --import my.domain.com
  +
  +
=== How to list all the imported keys ===
  +
* To see all the keys on the system
  +
# gpg --list-keys
  +
* To see only the repositories keys
  +
:* '''Ubuntu'''
  +
apt-key list
  +
:* '''Fedora/CentOS'''
  +
rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'

Revision as of 23:54, 8 June 2015

How to create a GPG key

  • Executhe the command
# gpg --gen-key
  • Choose:
    • 4096
    • No expiration date (0)
    • No passphrase (Hit <ENTER>)

How to commit a repository GPG signing key to a key server

# gpg --keyserver my.domain.com --send-keys ABCDE123

How to import a repository key

  • From a key server
# gpg --keyserver keyserver.ubuntu.com --recv-key F0DAA5410C667A3E
# gpg -a --export F0DAA5410C667A3E | apt-key add -
# apt-key update
  • From a file
  • Ubuntu
apt-key add my.domain.com
  • Fedora/CentOS
# rpm --import my.domain.com

How to list all the imported keys

  • To see all the keys on the system
# gpg --list-keys
  • To see only the repositories keys
  • Ubuntu
apt-key list
  • Fedora/CentOS
rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'