snipt

Ctrl+h for KB shortcuts

Bash

add gpg key to apt keyring

url="http://www.example.com/gpg.key"
wget -O - "$url" | sudo apt-key add -
https://snipt.net/embed/14af6e64ee94a94600c79800a4daed82/
https://snipt.net/raw/14af6e64ee94a94600c79800a4daed82/
14af6e64ee94a94600c79800a4daed82
bash
Bash
2
2016-09-28T17:44:19
True
False
False
/api/public/snipt/141321/
add-gpg-key-to-apt
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">url</span><span class="o">=</span><span class="s2">&quot;http://www.example.com/gpg.key&quot;</span> </span><span id="L-2"><a name="L-2"></a>wget -O - <span class="s2">&quot;</span><span class="nv">$url</span><span class="s2">&quot;</span> <span class="p">|</span> sudo apt-key add - </span></pre></div> </td></tr></table>
apt, gpg, key, linux

Bash

Decrypt a GPG file

$ gpg --output foo.txt --decrypt foo.txt.gpg
https://snipt.net/embed/1b9f7ddb9923ef297a00d6d1ab6f9ff9/
https://snipt.net/raw/1b9f7ddb9923ef297a00d6d1ab6f9ff9/
1b9f7ddb9923ef297a00d6d1ab6f9ff9
bash
Bash
1
2016-09-28T17:46:12
True
False
False
/api/public/snipt/24381/
decrypt-a-gpg-file
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">$ </span>gpg --output foo.txt --decrypt foo.txt.gpg </span></pre></div> </td></tr></table>
gnupg, gpg

Bash

Encrypt a file using gpg

$ gpg --yes -eq -r "Duplicity Encryption Key" -o fema.iso.gpg FEMA.iso
https://snipt.net/embed/503a25e37994f9bdefd8f42e63e8f2e1/
https://snipt.net/raw/503a25e37994f9bdefd8f42e63e8f2e1/
503a25e37994f9bdefd8f42e63e8f2e1
bash
Bash
1
2016-09-15T16:29:08
True
False
False
/api/public/snipt/22419/
encrypt-a-file-using-gpg
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">$ </span>gpg --yes -eq -r <span class="s2">&quot;Duplicity Encryption Key&quot;</span> -o fema.iso.gpg FEMA.iso </span></pre></div> </td></tr></table>
gpg

Bash

apt-get resolve gpg keys

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $KEY
https://snipt.net/embed/fe6c97954927fe10fad29180c13cbf77/
https://snipt.net/raw/fe6c97954927fe10fad29180c13cbf77/
fe6c97954927fe10fad29180c13cbf77
bash
Bash
2
2016-09-26T20:51:10
True
False
False
/api/public/snipt/20155/
apt-get-resolve-gpg-keys
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <span class="nv">$KEY</span> </span></pre></div> </td></tr></table>
apt-get, debian, gpg, keys, ubuntu

Text only

gpg key import

1
2
3
4
5
6
7
8
MySQL.com, you must first import and register their public GPG key:

   1. Download public key named build@mysql.com from http://www.keyserver.net/ with one of two methods:
          * wget --output-document=pubkey_mysql.asc http://keyserver.veridis.com:11371/export?id=-8326718950139043339
            (Saves key 0x5072E1F5 as file pubkey_mysql.asc)
          * gpg --keyserver keyserver.veridis.com --recv-key 5072e1f5
            gpg --export -a 5072e1f5 > pubkey_mysql.asc 
   2. Import key: rpm --import pubkey_mysql.asc 
https://snipt.net/embed/045bf903920fe2d9f906897d0ced6b34/
https://snipt.net/raw/045bf903920fe2d9f906897d0ced6b34/
045bf903920fe2d9f906897d0ced6b34
text
Text only
8
2016-09-28T07:16:48
True
False
False
/api/public/snipt/15974/
gpg-key-import
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>MySQL.com, you must first import and register their public GPG key: </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a> 1. Download public key named build@mysql.com from http://www.keyserver.net/ with one of two methods: </span><span id="L-4"><a name="L-4"></a> * wget --output-document=pubkey_mysql.asc http://keyserver.veridis.com:11371/export?id=-8326718950139043339 </span><span id="L-5"><a name="L-5"></a> (Saves key 0x5072E1F5 as file pubkey_mysql.asc) </span><span id="L-6"><a name="L-6"></a> * gpg --keyserver keyserver.veridis.com --recv-key 5072e1f5 </span><span id="L-7"><a name="L-7"></a> gpg --export -a 5072e1f5 &gt; pubkey_mysql.asc </span><span id="L-8"><a name="L-8"></a> 2. Import key: rpm --import pubkey_mysql.asc </span></pre></div> </td></tr></table>
gpg, import, key
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.