Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,844
Community Members
 
Community Events
165
Community Groups

ssh to private ec2 via bastion using ssh-run

Sukoon I'm New Here Jun 18, 2022

Hello,

I am trying to login into my private ec2 host via bastion host and execute a shell script in the host using following pipeline.

 

- pipe: "atlassian/ssh-run:0.4.1"
variables:
SSH_USER: 'ec2-user'
SERVER: $SERVER
SSH_KEY: $SSH_KEY
MODE: script
COMMAND: bitbucket-pipelines.sh
EXTRA_ARGS: -o ProxyCommand='ssh -i /root/.ssh/pipelines_id ec2-user@13.210.60.40 -W %h:%p'
But I always get below error :
Bad stdio forwarding specification '%h:%p'' 

 Output:

Status: Downloaded newer image for bitbucketpipelines/ssh-run:0.4.1

INFO: Executing the pipe...

INFO: Using passed SSH_KEY

INFO: Executing script bitbucket-pipelines.sh on 10.0.141.68

ssh -i /root/.ssh/pipelines_id -o StrictHostKeyChecking=no -p 22 -o ProxyCommand='ssh -i /root/.ssh/pipelines_id ec2-user@13.213.65.49 -W %h:%p' ec2-user@10.0.141.68 bash -s

Bad stdio forwarding specification '%h:%p''

✖ Execution failed.

 

Can someone please help me with this ? 

1 answer

@Sukoon  hi.

This problem relates to quoting.

For complex command escaping/quotas issue could happened, because pipelines infra also do some additional escaping for all passed variables to pass them throughout a docker infra.

 

We will investigate your issue and notify you.

Cheers.

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,218 views 2 9
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