Report this

What is the reason for this report?

How to I add a second key to the authorized_keys file

Posted on August 7, 2017

I need to add a public key to the .ssh/authorized_keys file on my server, how do I do this as I already see an key in there and I need to add a second one?

Thanks,



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Thanks. It was that simple.

Just add the new key on a new line in the same file.

I can paste anything into that shell. I am unable to ssh in from my terminal. When did this become such hassle?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.