# Add CircleCI to authorized\_keys

**URL:** <https://discuss.circleci.com/t/add-circleci-to-authorized-keys/28295>\
**Category:** Build Environment\
**Tags:** ssh\
**Created:** [February 12, 2019, 2:03am UTC](https://discuss.circleci.com/t/add-circleci-to-authorized-keys/28295 "2019-02-12T02:03:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sallymatson](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@sallymatson](https://discuss.circleci.com/u/sallymatson)\
**Post date:** [February 12, 2019, 2:03am UTC](https://discuss.circleci.com/t/add-circleci-to-authorized-keys/28295/1 "2019-02-12T02:03:44Z")

</div>

Hi,

CircleCI needs to ssh onto my server to access a file with environment variables, and also to integrate the code once it passes tests. However, when I try to scp onto the server (using the same command in my CircleCI 1.0 build that worked) it responds Permission Denied (Public Key). Is there a way to generate a new SSH key for CircleCI to add to my server, or is the issue something else?

Thanks.

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [February 12, 2019, 5:58pm UTC](https://discuss.circleci.com/t/add-circleci-to-authorized-keys/28295/2 "2019-02-12T17:58:17Z")

</div>

Can you share the steps you used to add the needed SSH key to the job?

Did you follow the directions here [https://circleci.com/docs/2.0/add-ssh-key/](https://circleci.com/docs/2.0/add-ssh-key/) (including `add_ssh_keys`)?

---

<div class="post-metadata">

**Author:** ![sallymatson](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@sallymatson](https://discuss.circleci.com/u/sallymatson)\
**Post date:** [February 13, 2019, 6:09pm UTC](https://discuss.circleci.com/t/add-circleci-to-authorized-keys/28295/3 "2019-02-13T18:09:56Z")

</div>

Hi, Yes! `add_ssh_key` did it. Thank you so much!

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [February 13, 2019, 6:11pm UTC](https://discuss.circleci.com/t/add-circleci-to-authorized-keys/28295/4 "2019-02-13T18:11:40Z")

</div>

Very glad to hear it!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [February 23, 2019, 6:11pm UTC](https://discuss.circleci.com/t/add-circleci-to-authorized-keys/28295/5 "2019-02-23T18:11:40Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
