Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Repo's ssh keys not copied to runner

Joris Vleminckx
Contributor
August 20, 2021

Hello,

 

We are experimenting with BB's Runners and things seemed to go well, until we found out that apparently the cloned repo's public SSH key is not copied to the Runner, so that it's not possible to connect through ssh to a local server to deploy.

The below works when run in an online pipeline.

Is this a bug?

INFO - Documentation built in 8.78 seconds
['ssh', '-p', '21191', '-o', 'StrictHostKeyChecking=no', 'ubuntu@201.217.240.108', '.local/bin/mkdocs_version.py --index www/whitemon/versions.json --create-folder add bardenas']
Warning: Permanently added '[201.217.240.108]:21191' (ECDSA) to the list of known hosts.
ubuntu@201.217.240.108: Permission denied (publickey).

1 comment

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 31, 2021

Hi @Joris Vleminckx

Thank you for reaching out to the community.

You should be able to use the SSH key from your Pipelines in your Runner's container.
Based on the error message, the SSH key you've used doesn't have permission to access your server.

Would it be possible for you to confirm if you're using SSH key added in your repository > Pipelines settings or you're using a custom SSH key from your environment variable?

Regards,
Mark C

Joris Vleminckx
Contributor
August 31, 2021

Hi Mark,

Thanks for answering.

We are using the pipeline ssh settings. When running in Bitbucket this works fine, with runners it doesn't.

Today we found out that the default location for the key isn't anymore  the standard `/opt/atlassian/pipelines/agent/.ssh` but a directory in /tmp (referred to in /root/.ssh/config):

```

# pwd
/root/.ssh
# cat config
IdentityFile /tmp/5a8171ea-ea02-576f-b735-0bdc7a484413/ssh/id_rsa
ServerAliveInterval 180

```

This link was useful: https://community.atlassian.com/t5/Bitbucket-questions/How-to-use-generated-SSH-KEY-in-pipelines/qaq-p/1024621

So using that new path made it work again. 

It would be good to point this out in the docs somewhere.

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 31, 2021

Hi @Joris Vleminckx

Indeed, by default, the /tmp folder volume is your working directory when you run your Pipelines runner container and you can also change that according to our documentation here.

Glad to know using the new path works.

I'll report this to the team to make sure to add that information in our docs.

Please feel free to let me know If you have any questions

Regards,
Mark C

Joris Vleminckx
Contributor
September 1, 2021

All clear for now. Thanks Mark.

Like Mark C likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events