Linux : How to export public key for others/friends or your recipients

Posted on in Categories News last updated April 8, 2005

1) Login to your shell account

2) Use –export option to export your public key in text file
$ gpg –export –a > my.key
OR
$ gpg –export -a | mail -s “My key” [email protected]

Where
-a –armor : Create ASCII armored output.
–export : Export the key for sharing

First command write output to file my.key and second directly sends an email to your friend. Once my.key delivered to friend, he/she need to import it using the following command (aka adding keys to your keyring):
$ gpg –import my.key

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Leave a Comment