Skip to content

Instantly share code, notes, and snippets.

@agungf agungf/gist:8803512
Created Feb 4, 2014

What would you like to do?
Remove passphrase (password) from private RSA key
Should also work for:
[v] any OpenSSH installation
Given, your key is in id_rsa
Passphrase is needed?
Try some host which has your public key (
> ssh my_user@myhost
You should get Enter passphrase for key kind of response
Remove passphrase
openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa_new
and enter your old passphrase
Replace key
Backup and replace your private ssh key
cp ~/.ssh/id_rsa ~/.ssh/id_rsa.backup
rm ~/.ssh/id_rsa
cp ~/.ssh/id_rsa_new ~/.ssh/id_rsa
Set key permissions
chmod 400 ~/.ssh/id_rsa
Test it
Now, following should log your into remote system, no questions asked
> ssh my_user@myhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.