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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,456,779
Community Members
 
Community Events
176
Community Groups

ssh to private ec2 via bastion using ssh-run

Edited

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@16.210.69.43 -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.9.181.1

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

2 answers

0 votes
Vu Ha I'm New Here Aug 06, 2022

@Sukoon for ssh-run just use JumpHost instead ProxyCommand 

EXTRA_ARGS: -J $SSH_USER@$BASTION_HOST 
for rsync-deploy use ProxyCommand
SSH_ARGS: '-v -o StrictHostKeyChecking=no -o ProxyCommand="ssh -W %h:%p -q $SSH_USER@$BASTION_HOST" -l $SSH_USER'

@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

Atlassian Community Events