Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to deploy through proxy server passing private key Edited

I am deploying through pm2 and a proxy server (BitbucketPipeline -> authentication to B -> deploying to C)

Here is my pipeline

image: node:8.11.2

- step:
- node
- npm run test
- mkdir -p ~/.ssh
- cat bitbucket-ssh-config >> ~/.ssh/config
- npm install -g pm2
- npm run deploy-development # triggers pm2 deployment

Here  is my bitbucket-ssh-config :

Hostname C
IdentityFile ~/.ssh/id_rsa
ProxyCommand ssh -i ~/.ssh/id_rsa -W %h:%p USER@B 

It seems to work perfectly but i get the following error :

Warning: Identity file /root/.ssh/id_rsa not accessible: No such file or directory. 

I could generate my own private key but I prefer to use the default one, how can I do ? 



I finally tried to use "/opt/atlassian/pipelines/agent/ssh/id_rsa"

I was successfully connecting to the server "B" directly but getting an error after:

ssh_exchange_identification: Connection closed by remote host

So I tried to re-generate the key pair. And I append it to ".ssh/authorized_keys" of both servers (B & C) and now it doesn't work anymore and i can't even ssh to the server B ?


EDIT 2 :

I finally tried with a custom key pair by adding this script step 

- (umask  077 ; echo $DEV_PIPELINE_KEY | base64 --decode > ~/.ssh/id_rsa)

It suvccessfully authenticate through the gateway but then it's blocked and I don't get why as I use th exact same way from my computer


Warning: Permanently added the RSA host key for IP address 'xxxxxx' to the list of known hosts.
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Authentication succeeded (publickey).
Authenticated to ([xxxxxxxx]:22).
debug1: channel_connect_stdio_fwd xxxxxx:22
debug1: channel 0: new [stdio-forward]
debug1: getpeername failed: Bad file descriptor
debug1: Requesting
debug1: Entering interactive session.
debug1: client_input_global_request: rtype want_reply 0
Host key verification failed.
debug1: channel 0: free: direct-tcpip: listening port 0 for xxxxxx port 22, connect from port 65535 to UNKNOWN port 65536, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: Killed by signal 1.


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

762 views 15 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you