Skip to content

Instantly share code, notes, and snippets.

@vision2910
Last active April 5, 2017 06:57
Show Gist options
  • Select an option

  • Save vision2910/454f0a16dd61709b75e0 to your computer and use it in GitHub Desktop.

Select an option

Save vision2910/454f0a16dd61709b75e0 to your computer and use it in GitHub Desktop.
GPG
1- create
gpg --gen-key
2- list
gpg --list-keys
OR
gpg -k
Above command will show the key from the public keyring. To view the secret key ring, use- gpg --list-secret-keys (OR gpg -K)
3- export
To send your public key to a correspondent you must first export it-
gpg --output <public-gpg-key.gpg> --armor --export [email protected]
OR
gpg --armor --export [email protected] > gpg-pubkey-himanshu.asc
4- import
(download public key from the requester and then go to the location where that file exists)
A public key may be added to your public keyring with the --import option
gpg --import blake.gpg
5- encrypting
gpg -e <filename>
OR
gpg --output doc.gpg --encrypt --recipient [email protected] doc
OR
gpg -e -u "Sender User Name" -r "Receiver User Name" somefile
There are some useful options here, such as -u to specify the secret key to be used, and -r to specify the public key of the recipient.
6- decrypting
gpg --output <filename> --decrypt <filename>.gpg
OR
pg -d secret.txt.gpg
7- Delete
gpg --delete-secret-keys '[email protected]
& then-
gpg --delete-key '[email protected]
8- Backup & transfer secret/pub keys-
http://support.gpgtools.org/kb/faq-gpg-keychain-access/backup-or-transfer-your-keys
http://montemazuma.wordpress.com/2010/03/01/moving-a-gpg-key-privately/
Copying pvt & pub keys to other system(http://www.phildev.net/pgp/gpg_moving_keys.html)-
$ gpg --export-secret-keys -a keyid > my_private_key.asc
$ gpg --export -a keyid > my_public_key.asc
Where keyid is your PGP Key ID, such as A1E732BB.
$ gpg --import my_private_key.asc
$ gpg --import my_public_key.asc
ref:
http://www.ianatkinson.net/computing/gnupg.htm
http://www.madboa.com/geek/gpg-quickstart/
https://www.gnupg.org/gph/en/manual/x56.html
http://aplawrence.com/Basics/gpg.html
http://fedoraproject.org/wiki/Creating_GPG_Keys#Making_Your_Public_Key_Available
-------------
https://www.gnupg.org/gph/en/manual.html
http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/gpg-cs.html
http://www.spywarewarrior.com/uiuc/gpg/gpg-com-4.htm#4-12
=============================
htpasswd
ref
http://weavervsworld.com/docs/other/passprotect.html
htpasswd -c . hprakash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment