Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Deploy bitbucket files to remote server by SSH key

We need to deploy files to remote server using by SSH key only. I have tried the below code. But it is not working.

- step:
name: Deploy to test
deployment: test
- pipe: atlassian/sftp-deploy:0.5.7
USER: 'ubuntu'
REMOTE_PATH: '/var/www/vhosts/'
SSH_KEY: '$my_ssh'
DEBUG: 'true'
EXTRA_ARGS: '-o ServerAliveInterval=10'Pipeline Result.PNG

Pipeline Log file.PNG

It is showing the error as I have attached here for your reference.

Please check and do the needful quickly.

1 answer

0 votes

Hi @Karthik Kumar  and welcome to the community.

Based on the screenshot of the Pipelines log, it looks that SSH authentication is succeeding.

Later on in the output, we see the errors:

debug1: Couldn't stat remote file: Permission denied
debug1: Couldn't stat remote file: Permission denied
File "/var/www/vhosts/" not found.

This indicates that the issue may have to do with the permissions of the USER you have specified in the definition of of the pipe.

1. Does the path /var/www/vhosts/ exist on your remote server?

2. In the definition of the pipe in your yml file, you have specified USER: 'ubuntu'.
Does the user ubuntu on this server have permissions to create files in the directory /var/www/vhosts/ of your server?

Kind regards,

Suggest an answer

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

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

111 views 2 4
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