« Back to SSH: Frequently Asked Questions

How to remove the passphrase from a SSH key

How to remove the passphrase from a SSH key?

Use the ssh-keygen command to update the passphrase of an existing SSH key.

ssh-keygen -p -f /path/to-key-file

The passphrase on a SSH key can be removed using the ssh-keygen command with the -p. This will interactively ask for the existing passphrase and provides the option to clear it.

# ssh-keygen -p -f /path/to/key-file
Enter old passphrase: 
Key has comment 'mykey'
Enter new passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved with the new passphrase.

Other questions related to SSH

    Related articles

    Like to learn more? Here is a list of articles within the same category or having similar tags.

    Feedback

    Small picture of Michael Boelen

    This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

    Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

    Mastodon icon