commonplace
  • Commonplace
  • AWS
    • Control Tower
      • Building a Scalable and Secure Multi-VPC AWS Network Infrastructure
    • Talks / Articles
      • Encrypting Everything with AWS (SEP402)
      • The Tension Between Absolutes & Ambiguity in Security (SEC310)
      • Best practices for authoring AWS CloudFormation (DOP302-R1)
    • Useful Links
    • Notes
      • awscli
      • Cloudformation
        • Using Parameters
  • Infrastructure Security
    • Amazon Web Services
      • Tools
    • Tools
  • Security
    • Articles
      • If You're Not Doing Continuous Asset Management You're Not Doing Security | Daniel Miessler
      • Living Off the Land
        • Living Off The Land: Part 2
    • Cryptography
      • Shamir Secret Sharing Algorithm
    • Distros
      • REMnux
    • DoD
    • Email
    • GPG
    • Shodan
    • SSH
  • Resources
    • AWS Toolbox
    • CTF
      • AWS
    • Dev Setup
      • Windows Terminal
    • Documentation
      • MOCK Press Release Template
      • Design Document Template
    • Docker
      • Notes
      • Configure Docker w/TLS for WSL
    • Kubernetes
      • Raspberry Pi 4 (4GB) Cluster
    • Linux
      • zsh config
      • Users and Groups
    • Python
      • AWS
        • Lambda
      • Random Strings
    • Security News
    • Tools
    • Unity SSDLC
    • vscode
      • Cloudformation
    • Windows
      • WSL2
        • Scratchpad
        • Install a GUI (xfce)
        • Creating Additional WSL2 Instances
    • Youtubers
      • youtube-dl snippets
  • Lab
    • Building a Better Workstation
      • Notes / Guide
  • Misc
    • Notes
      • youtube-dl
  • Recipes
Powered by GitBook
On this page
  • GPG: Extract private key and import on different machine
  • GPG: Change key passphrase

Was this helpful?

  1. Security

GPG

GPG: Extract private key and import on different machine

After extending the expiry date of a GPG key you might have to copy your key to another machine to use the same key there. Here is how:

  1. Identify your private key by running gpg --list-secret-keys. You need the ID of your private key (second column)

  2. Run this command to export your key: gpg --export-secret-keys $ID > my-private-key.asc

  3. Copy the key to the other machine (scp is your friend)

  4. To import the key, run gpg --import my-private-key.asc

If the key already existed on the second machine, the import will fail saying 'Key already known'. You will have to delete both the private and public key first (gpg --delete-keys and gpg --delete-secret-keys)

GPG: Change key passphrase

  • Enter:

    gpg --edit-key key-id
  • At the gpg prompt enter:

    passwd
  • Enter the current passphrase when prompted.

  • Enter the new passphrase twice when prompted.

  • Enter:

    save

You have now changed the passphrase.

PreviousEmailNextShodan

Last updated 5 years ago

Was this helpful?