Skip to content

Instantly share code, notes, and snippets.

@agungf
Created February 4, 2014 13:25
Show Gist options
  • Select an option

  • Save agungf/8803512 to your computer and use it in GitHub Desktop.

Select an option

Save agungf/8803512 to your computer and use it in GitHub Desktop.

Revisions

  1. agungf created this gist Feb 4, 2014.
    44 changes: 44 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    Should also work for:

    [v] any OpenSSH installation

    Given, your key is in id_rsa
    1
    Passphrase is needed?


    Try some host which has your public key (id_rsa.pub)

    > ssh my_user@myhost

    You should get Enter passphrase for key kind of response

    2
    Remove passphrase


    openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa_new

    and enter your old passphrase

    3
    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
    4
    Set key permissions


    chmod 400 ~/.ssh/id_rsa
    5
    Test it


    Now, following should log your into remote system, no questions asked

    > ssh my_user@myhost