Some unrelated thoughts

?

Archives April 2010

Restore a SSH public key

I recently had the problem that I had on a system the private part of the SSH key but its public part got lost. Generating a new key pair wasn't possible as the public part was still installed on other systems for proper public key authentication and I could not change this.

So, I needed to restore the public part of the SSH key. After a bit of using my favourite search engine, I noticed that it is way easier than I expected:

ssh-keygen -y -f ~/.ssh/id_rsa

This command will print the public part of the key in ...

gpg-update-key

If you are using GnuPG, you may receive new signatures or do other changes to your GPG key and want to upload it to keyservers and/or your webserver to make it easier for other people to find it.

Since this is a tedious task, I wrote a little script "gpg-update-key" which does the job for me:

#!/bin/sh

KEY="CC03633F700990F2"
REMOTE_DIR="myserver.org:/var/www"

# upload the key to some key servers
gpg --keyserver subkeys.pgp.net --send-key ${KEY}
gpg --keyserver pool.sks-keyservers.net --send-key ${KEY}
gpg --keyserver pgp.uni-mainz.de --send-key ${KEY}
gpg --keyserver pgp.surfnet.nl --send-key ...

Daily archives