Do I have to give location to SSH key everytime I login via SSH?

Posted September 6, 2018 1.3k views
SecurityUbuntu 16.04

Hi I just set up ssh keys using openssh and added them to my droplet following the guides. The ssh keys have been saved in a non-default folder on my computer. During my first login via ssh I used the command

ssh -i /path/to/private/key username@

I was asked to enter my passphrase and upon entering it given access. All good till here.

Now the second time I logged in, I enterered

ssh username@

But this did not log me in directly.

So I had to use just like the first time

ssh -i /path/to/private/key username@

and enter my passphrase.

Is this normal and happening because my SSH key is in a non-default folder? Or am I doing anything wrong?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

One way would be to add your public keys to your Digital Ocean account (in the Security tab Then when you create your droplet, you can reference these by the ID. API ref: