Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Let's avatar
Level 4

SSH to Digital Ocean only works for keys named "id_rsa"

Hi,

I'm following this tutorial https://laracasts.com/series/server-management-with-forge/episodes/4.

I can't SSH into my Digital Ocean droplet when I use different name for my keys file. It only works with id_rsa

ssh-keygen -t rsa -C "[email protected]"

When I rename the key, it says

Permission denied (publickey).

How come? Thanks.

I'm using a Mac.

0 likes
2 replies
EliasSoares's avatar
Level 10

You need to configure your ssh-agent to use you key.

It defaults to id_rsa...

ssh-add ~/.ssh/id_rsa
```
1 like
Let's avatar
Level 4

Thank you!!

I did

ssh-add ~/.ssh/mykey

Please or to participate in this conversation.