# SSH key don't login

**URL:** <https://discuss.circleci.com/t/ssh-key-dont-login/29020>\
**Category:** Deployments\
**Created:** [March 15, 2019, 1:26pm UTC](https://discuss.circleci.com/t/ssh-key-dont-login/29020 "2019-03-15T13:26:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppsirius](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ppsirius/32/21682_2.png) [@ppsirius](https://discuss.circleci.com/u/ppsirius)\
**Post date:** [March 15, 2019, 1:26pm UTC](https://discuss.circleci.com/t/ssh-key-dont-login/29020/1 "2019-03-15T13:26:33Z")

</div>

I use RSA key that I added in Circle CI web app. On deploy job I add key, output is “Installed key d6:75:b5…” but when I’m try to copy files by scp i get

```
Warning: Permanently added '[s11.vdl.pl]:59184,[46.4.105.132]:59184' (RSA) to the list of known hosts.
xxx@s11.vdl.pl's password: 
Too long with no output (exceeded 10m0s)

```

This is my deploy job

```
deploy:
machine:
  enabled: true
steps:
  - add_ssh_keys
  - attach_workspace:
      at: public
  - run:
      name: check files
      command: |
        pwd && ls -al
  - run:
      name: Deploy Over SSH
      command: |
        scp -P $SSH_PORT -r ~/project/public/ $SSH_USER@$SSH_HOST:$SSH_PATH
```

---

<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:** [March 15, 2019, 2:05pm UTC](https://discuss.circleci.com/t/ssh-key-dont-login/29020/2 "2019-03-15T14:05:47Z")

</div>

I assume this key is added to the `~/.ssh/authorized_keys` file on your server, but it looks like the server is ignoring the key and try to fallback to user/pass login.

I would suggest running an SSH job [https://circleci.com/docs/2.0/ssh-access-jobs/](https://circleci.com/docs/2.0/ssh-access-jobs/) so you can check the files and troubleshoot, it makes things a lot easier.

---

<div class="post-metadata">

**Author:** ![ppsirius](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ppsirius/32/21682_2.png) [@ppsirius](https://discuss.circleci.com/u/ppsirius)\
**Post date:** [March 18, 2019, 4:06pm UTC](https://discuss.circleci.com/t/ssh-key-dont-login/29020/3 "2019-03-18T16:06:36Z")

</div>

I want to figure out what is wrong without SSH job 🙂  
When i run command

```
#!/bin/bash -eo pipefail
ls -la ~/.ssh/ && cat ~/.ssh/config && cat authorized_keys && cat config
total 20
drwx------ 2 circleci circleci 4096 Mar 18 15:54 .
drwxr-xr-x 16 circleci circleci 4096 Mar 18 15:54 ..
-rw-r--r-- 1 root root 214 Mar 18 15:54 authorized_keys
-rw-rw-r-- 1 circleci circleci 112 Mar 18 15:54 config
-rw------- 1 circleci circleci 1679 Mar 18 15:54 id_rsa_d675b5f987835b0ac2d588e7d845bb06
Host s78.vdl.pl
IdentitiesOnly yes
IdentityFile /home/circleci/.ssh/id_rsa_d675b5f987835b0ac2d588e7d845bb06
cat: authorized_keys: No such file or directory
Exited with code 1  

```

I see the files when I’m listing them but can’t enter them id\_rsa\_d675… also don’t run. Maybe I should copy somehow this keys?

I must do something more than paste private ssh key in to Circle CI settings?

---

<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:** [March 18, 2019, 5:07pm UTC](https://discuss.circleci.com/t/ssh-key-dont-login/29020/4 "2019-03-18T17:07:41Z")

</div>

No, that should be all that is needed. Did you double-check you are able to login to your server outside on CircleCI using this key?
