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
Community Members
Community Events
Community Groups

ssh to private ec2 via bastion using ssh-run

Sukoon I'm New Here Jun 18, 2022


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"
SSH_USER: 'ec2-user'
MODE: script
EXTRA_ARGS: -o ProxyCommand='ssh -i /root/.ssh/pipelines_id ec2-user@ -W %h:%p'
But I always get below error :
Bad stdio forwarding specification '%h:%p'' 


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

INFO: Executing the pipe...

INFO: Using passed SSH_KEY

INFO: Executing script on

ssh -i /root/.ssh/pipelines_id -o StrictHostKeyChecking=no -p 22 -o ProxyCommand='ssh -i /root/.ssh/pipelines_id ec2-user@ -W %h:%p' ec2-user@ 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.


Suggest an answer

Log in or Sign up to answer
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