Search code examples
linuxubuntusshdigital-oceanputty

Change private key for DigitalOcean SSH


I have private key that I use to ssh login to my digitalocean server, the private has a pass phrase,

I need to enter every time I login, I want to change that with a new private key that has no pass phrase.

I also have it asks for pass when I pull from my private github.

I can't automate my actions because of that.

How can I do it?


Solution

  • If it is only because of passphrase you need to change your SSH key, you can remove the passphrase by following the steps below:

    ssh-keygen -p
    
    Enter old passphrase
    
    Enter new passphrase - [Leave it blank]
    
    Confirm new passphrase - [Leave it blank] 
    

    If you really need a second SSH key, just create one and put your SSH public key in ~/.ssh/authorized_keys file in your DigitalOcean droplet. You should then be able to login using your new private key.