Ssh Access

ssh
keys

#1

Hi,

I’m new in using CircleCI and also don’t have experience with SSH using public key.

Am i eligible to SSH into the machine running the build to debug my problems although i can’t ping that machine from my PC ?

Can you give me a step by step on how to SSH the running machine using PUTTY ?


#2

Do you have a public key created on your machine, and have you uploaded the key to GitHub?


#3

Using Ubuntu on VM-Ware
When i try to
$ssh git@github.com

I got:

Warning: Permanently added the RSA host key for IP address ‘192.30.252.131’ to the list of known hosts.
Enter passphrase for key ‘/root/.ssh/id_rsa’:
PTY allocation request failed on channel 0
Hi AhmadMohammadYahya! You’ve successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.


#4

Right, it looks you don’t have your key on GitHub yet.

  1. Create a Key
    ssh-keygen on the Ubuntu machine

  2. Upload it to your GitHub

  3. When you rebuild with SSH, CircleCI will automatically get your public key from GitHub and allow you to log in.


#5

But when i try

ssh -p xxxxx ubuntu@xx.xxx.xxx.xx
"Which is the command given to ssh the running machine in Circle CI"

I got:
ssh: connect to host xx.xxx.xxx.xx port xxxxx: Connection timed out


#6

Can you make sure you have the steps from above completed and then try again?


#7

I got the same timeout problem.

How could i know that Circle CI is using my public key on GitHub ?
I’m seeing Host “fingerprint:” in the running build which is different from that on my github ?!


#8

I also see on my git hub account below the uploaded key:
Added on Oct 31, 2015 — Never used


#9

Can you paste the output of ssh -v -p xxxxx ubuntu@xx.xxx.xxx.xx (using the port and IP)


#10

$ ssh -v -p xxxxx ubuntu@xx.xxx.xxx.xx
OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to xx.xxx.xxx.xx [xx.xxx.xxx.xx] port xxxxx.
debug1: connect to address xx.xxx.xxx.xx port xxxxx: Connection timed out
ssh: connect to host xx.xxx.xxx.xx port xxxxx: Connection timed out


#13

I got the same problem from windows7

C:\Program Files (x86)\PuTTY>plink.exe -v -P xxxxx ubuntu@xx.xxx.xxx.xx
Looking up host "xx.xxx.xxx.xx"
Connecting to xx.xxx.xxx.xx port xxxxx
Failed to connect to xx.xxx.xxx.xx: Network error: Connection timed out
Network error: Connection timed out
FATAL ERROR: Network error: Connection timed out


#14

Can you do it with ssh -vvv we need more logging that this.


#15

ssh -vvv -p xxxxxubuntu@xx.xxx.xxx.xx
OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
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 xx.xxx.xxx.xx [xx.xxx.xxx.xx] port xxxxx.
debug1: connect to address xx.xxx.xxx.xx port xxxxx: Connection timed out
ssh: connect to host xx.xxx.xxx.xx port xxxxx: Connection timed out


#16

Project URL:
https://circleci.com/gh/AhmadMohammadYahya/commons-csv/19


#17

We are not aware of any issues with SSH, this may be related to something in your local environment or local network. Could you try these steps from a different computer or on a different network to see if you are still having these issues?


#18

I just looked at this thread and I think you both try to do something completely different. What I understand:

@AhmadMohammadYahya wants to know wether he can access the CircleCI build server using SSH to debug. (Private <==> CircleCI)

@levlaz describes how CircleCI can access the GitHub repository via SSH. (CircleCI <==> GitHub)

If I didn’t understand it correct, ignore me and I’ll go away and shame.


#19

CircleCI uses your Github keys to grant you SSH access to their boxes, so both are sorta correct.


#20

Haven’t found this in the docs. Do you have a link?


#21

It looks like @AhmedMohammadYahya was having issues SSHing into his build so the steps I suggested would help us troubleshoot those a bit.

We do have some documentation on how the SSH process works here.


#22

Now I understand why I misunderstood your conversation: I don’t have this tab available in my builds.