# Cant connect to job using ssh

**URL:** <https://discuss.circleci.com/t/cant-connect-to-job-using-ssh/39353>\
**Category:** Integrations and Accounts\
**Tags:** nodejs\
**Created:** [March 9, 2021, 4:39pm UTC](https://discuss.circleci.com/t/cant-connect-to-job-using-ssh/39353 "2021-03-09T16:39:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Npervic](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/npervic/32/26882_2.png) [@Npervic](https://discuss.circleci.com/u/Npervic)\
**Post date:** [March 9, 2021, 4:39pm UTC](https://discuss.circleci.com/t/cant-connect-to-job-using-ssh/39353/1 "2021-03-09T16:39:01Z")

</div>

Hey there. I’m having some trouble with flaky tests on a node-js job I have configured with circle-ci. I’m trying to ssh into the job so that I can run tests manually and try to debug (the flaky tests are fine in local env). Once i re run job with ssh and the `Wait for SSH session` step turns green I’m getting `Connection refused` using the ssh -p command that this step suggests. Using `-v` with ssh hangs a bit on ` Connecting to ...` and then it drops with `Connection timed out`.

I should mention that the terminal I try this in is used over VPN (its my office ubuntu machine).

Any idea why this is happening?

---

<div class="post-metadata">

**Author:** ![Npervic](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/npervic/32/26882_2.png) [@Npervic](https://discuss.circleci.com/u/Npervic)\
**Post date:** [June 2, 2021, 12:59pm UTC](https://discuss.circleci.com/t/cant-connect-to-job-using-ssh/39353/2 "2021-06-02T12:59:02Z")

</div>

Actually the wrong ssh key was used so once i added -i and path to right ssh it worked.

---

<div class="post-metadata">

**Author:** ![thekatertot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/thekatertot/32/25169_2.png) [@thekatertot](https://discuss.circleci.com/u/thekatertot)\
**Post date:** [June 7, 2021, 4:20pm UTC](https://discuss.circleci.com/t/cant-connect-to-job-using-ssh/39353/3 "2021-06-07T16:20:35Z")

</div>

Thanks for posting the solution!

---

<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:** [June 17, 2021, 4:20pm UTC](https://discuss.circleci.com/t/cant-connect-to-job-using-ssh/39353/4 "2021-06-17T16:20:41Z")

</div>

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