# Can't SSH into Build Machine

**URL:** <https://discuss.circleci.com/t/cant-ssh-into-build-machine/558>\
**Category:** Build Environment\
**Created:** [November 16, 2015, 9:32pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558 "2015-11-16T21:32:47Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/tom/32/27680_2.png) [@tom](https://discuss.circleci.com/u/tom)\
**Post date:** [May 20, 2016, 2:15pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/21 "2016-05-20T14:15:17Z")

</div>

@turbomerl Thanks for the update. Can you lodge a support ticket from the account you’re using and we can enable SSH for OS X for your account.

---

<div class="post-metadata">

**Author:** ![glesage](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/glesage/32/1224_2.png) [@glesage](https://discuss.circleci.com/u/glesage)\
**Post date:** [May 20, 2016, 2:20pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/22 "2016-05-20T14:20:42Z")

</div>

Thank you for looking into this tom, I’ve also created a support ticket several days ago

[https://circleci.zendesk.com/hc/en-us/requests/6559](https://circleci.zendesk.com/hc/en-us/requests/6559)

I can see the “Enable SSH” row during the build and get the link just fine but the authentication does not work… I am the owner of the github organization too, and was the one who created all the repos.

 ![](https://global.discourse-cdn.com/circleci/original/2X/9/99eb2527c1e1577a7242efefea77d14f7f31dde9.png)

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/tom/32/27680_2.png) [@tom](https://discuss.circleci.com/u/tom)\
**Post date:** [May 20, 2016, 2:24pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/23 "2016-05-20T14:24:12Z")

</div>

@glesage Thanks for the info. Sorry we hadn’t responded to your ticket yet - it’s been a bit hectic this week!

---

<div class="post-metadata">

**Author:** ![glesage](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/glesage/32/1224_2.png) [@glesage](https://discuss.circleci.com/u/glesage)\
**Post date:** [May 20, 2016, 3:03pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/24 "2016-05-20T15:03:53Z")

</div>

Hey FYI everyone, apparently circle-ci has to “enable SSH for the organization” before we can use it… so its not broken, its just turned off.

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/tom/32/27680_2.png) [@tom](https://discuss.circleci.com/u/tom)\
**Post date:** [May 20, 2016, 3:05pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/25 "2016-05-20T15:05:02Z")

</div>

Just to clarify - this is just for builds running on OS X

---

<div class="post-metadata">

**Author:** ![turbomerl](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@turbomerl](https://discuss.circleci.com/u/turbomerl)\
**Post date:** [May 23, 2016, 8:30am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/26 "2016-05-23T08:30:42Z")

</div>

@tom - thanks for that! I will file a ticket

---

<div class="post-metadata">

**Author:** ![turbomerl](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@turbomerl](https://discuss.circleci.com/u/turbomerl)\
**Post date:** [May 23, 2016, 9:26am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/27 "2016-05-23T09:26:36Z")

</div>

@tom - I don’t seem to have the ability to file a ticket yet - is this because I am just coming to the end of my free trial and haven’t gone on to the paid program yet, or am I being dim? Thanks 🙂

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/tom/32/27680_2.png) [@tom](https://discuss.circleci.com/u/tom)\
**Post date:** [May 23, 2016, 9:44am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/28 "2016-05-23T09:44:03Z")

</div>

@turbomerl Sorry about that - ticket support via the UI is for paid plans only. You can send an email to sayhi@ and I’ll get it set up for you.

---

<div class="post-metadata">

**Author:** ![turbomerl](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@turbomerl](https://discuss.circleci.com/u/turbomerl)\
**Post date:** [May 23, 2016, 10:19am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/29 "2016-05-23T10:19:31Z")

</div>

thanks @tom - I submitted the request and mentioned you.

---

<div class="post-metadata">

**Author:** ![kariavka](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kariavka/32/15040_2.png) [@kariavka](https://discuss.circleci.com/u/kariavka)\
**Post date:** [January 5, 2017, 4:49pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/30 "2017-01-05T16:49:17Z")

</div>

Same issue (((

```auto
livarava-develop@scephei:~$ ssh -vvv -p 64745 ubuntu@54.161.57.211
OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 54.161.57.211 [54.161.57.211] port 64745.
debug1: Connection established.
debug1: identity file /home/livarava-develop/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/livarava-develop/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/livarava-develop/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/livarava-develop/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/livarava-develop/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/livarava-develop/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/livarava-develop/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/livarava-develop/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 pat OpenSSH_6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug3: put_host_port: [54.161.57.211]:64745
debug3: load_hostkeys: loading entries for host "[54.161.57.211]:64745" from file "/home/livarava-develop/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/livarava-develop/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-ed25519,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA e2:f5:9b:4c:bd:72:6d:cf:43:95:2d:ef:db:4e:e3:61
debug3: put_host_port: [54.161.57.211]:64745
debug3: put_host_port: [54.161.57.211]:64745
debug3: load_hostkeys: loading entries for host "[54.161.57.211]:64745" from file "/home/livarava-develop/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/livarava-develop/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "[54.161.57.211]:64745" from file "/home/livarava-develop/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/livarava-develop/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys
debug1: Host '[54.161.57.211]:64745' is known and matches the ECDSA host key.
debug1: Found key in /home/livarava-develop/.ssh/known_hosts:4
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/livarava-develop/.ssh/id_rsa (0x7fb7d0b53220),
debug2: key: /home/livarava-develop/.ssh/id_dsa ((nil)),
debug2: key: /home/livarava-develop/.ssh/id_ecdsa ((nil)),
debug2: key: /home/livarava-develop/.ssh/id_ed25519 ((nil)),
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/livarava-develop/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/livarava-develop/.ssh/id_dsa
debug3: no such identity: /home/livarava-develop/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/livarava-develop/.ssh/id_ecdsa
debug3: no such identity: /home/livarava-develop/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/livarava-develop/.ssh/id_ed25519
debug3: no such identity: /home/livarava-develop/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
bash: handle_virtualenv: command not found

```

---

<div class="post-metadata">

**Author:** ![danielcompton](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/danielcompton/32/80_2.png) [@danielcompton](https://discuss.circleci.com/u/danielcompton)\
**Post date:** [January 31, 2017, 4:26am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/31 "2017-01-31T04:26:06Z")

</div>

I’ve got this issue too. Do I need to enable something on the account?

---

<div class="post-metadata">

**Author:** ![zzak](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/zzak/32/4233_2.png) [@zzak](https://discuss.circleci.com/u/zzak)\
**Post date:** [February 10, 2017, 7:59am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/32 "2017-02-10T07:59:13Z")

</div>

Hello @kariavka, @danielcompton,

Could you please reach out to [support@circleci.com](mailto:support@circleci.com) and we’ll figure this out?

Best,  
Zak

---

<div class="post-metadata">

**Author:** ![guillett](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/guillett/32/15720_2.png) [@guillett](https://discuss.circleci.com/u/guillett)\
**Post date:** [March 21, 2017, 4:40pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/33 "2017-03-21T16:40:20Z")

</div>

Hello @zzak,

I have a similar issue but it is not occurring all the time.

Here are extracts of **ssh -v**  
In a scenario I can connect to the instance:  
debug1: SSH2\_MSG\_NEWKEYS sent  
debug1: expecting SSH2\_MSG\_NEWKEYS  
debug1: SSH2\_MSG\_NEWKEYS received  
debug1: SSH2\_MSG\_SERVICE\_REQUEST sent  
debug1: SSH2\_MSG\_SERVICE\_ACCEPT received  
debug1: Authentications that can continue: publickey  
debug1: Next authentication method: publickey  
debug1: Offering RSA public key: xxx  
debug1: Server accepts key: pkalg ssh-rsa blen 277  
debug1: Authentication succeeded (publickey).

When it is not working:  
debug1: SSH2\_MSG\_NEWKEYS sent  
debug1: expecting SSH2\_MSG\_NEWKEYS  
debug1: SSH2\_MSG\_NEWKEYS received  
debug1: SSH2\_MSG\_SERVICE\_REQUEST sent  
debug1: SSH2\_MSG\_SERVICE\_ACCEPT received  
debug1: Authentications that can continue: publickey  
debug1: Next authentication method: publickey  
debug1: Offering RSA public key: xxx  
debug1: Authentications that can continue: publickey  
debug1: No more authentication methods to try.  
Permission denied (publickey).

Hope that helps. I can send you a full log on `ssh -v`if you want.

---

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 5, 2018, 4:55pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/34 "2018-03-05T16:55:04Z")

</div>

So I am new to CircleCI - and I am trying to figure out myself - but dumb question - do I need a container for me to ssh into or I can ssh into a specific instance for that build so I can debug also?

[Update]  
Ok maybe I was confusing myself a little when I saw “Add Container” in my build - it already uses a container already for free ( i think) - so In my build I saw the following:

`ssh -p 64544 54.162.166.58` on the ENABLE SSH job - I take it that is something specific for CircleCI to access, but I tried to do ssh -i mybitbucket-id-rsa -p 64544 54.162.166.58 - still no go since I read somewhere for the following to do:

$ ssh -i /Users/me/.ssh/id\_rsa\_github -p 64784 [ubuntu@54.224.97.243](mailto:ubuntu@54.224.97.243)

But I also assume ubuntu up there would be my username on circleCI right?

---

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 5, 2018, 5:32pm UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/35 "2018-03-05T17:32:35Z")

</div>

Ok I figured it out - it was me not adding my ssh key to my ssh agent. BUT another issue I see is that my container does not have the correct configured ssh key I inputted on the build’s SSH setting.

circleci@7d95b82a8ff5:~/.ssh$ ls -l  
total 8  
-rw------- 1 circleci circleci 1676 Mar 5 17:26 id\_rsa  
-rw-r–r-- 1 circleci circleci 1672 Mar 5 17:26 known\_hosts

Like if I added a key called tp-dev

I should see tp-dev in that directory right?

---

<div class="post-metadata">

**Author:** ![Saranya](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@Saranya](https://discuss.circleci.com/u/Saranya)\
**Post date:** [May 23, 2018, 7:39am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/36 "2018-05-23T07:39:58Z")

</div>

Hi Team,

Iam facing ssh issue when Iam trying to do build in ubuntu machine.Could you please suggest solution for this.

debug1: No more authentication methods to try.

Permission denied (publickey).

Exited with code 255

---

<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:** [August 21, 2018, 7:40am UTC](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558/37 "2018-08-21T07:40:16Z")

</div>

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

[Previous page](https://discuss.circleci.com/t/cant-ssh-into-build-machine/558.md?page=1)
