Adding GPG Cheatsheet
This commit is contained in:
51
GPG.md
Normal file
51
GPG.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# GPG Cheatsheet
|
||||||
|
|
||||||
|
A collection of GPG commands I use and still don't remember.
|
||||||
|
|
||||||
|
### List keys
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg -k
|
||||||
|
```
|
||||||
|
|
||||||
|
### Edit a key
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg --edit-key <key_id>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Import a public key
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg --import <keyfile>.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
### Export a public key
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg --export -a <user_or_email> > <outputfile>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Export a private key
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg --export-secret-key -a <user_or_email> > <outputfile>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Encrypt a message
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg --encrypt --armor -r <user_or_email> <inputfile>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Decrypt a message
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg --decrypt --output <outputfile> <inputfile>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Update keys on server
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gpg --keyserver pgp.mit.edu --send-keys <key_id>
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user