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

Your Points Tracker
Challenges
Leaderboard
  • 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
Recognition
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?
Kudos
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

Permission denied for SSH on Pipelines

Hi there,

I followed this guideline to create a new SSH key for my repo:

https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html

I created it in the repo settings (also added the server to the known hosts) and added the public key on the remote server.

 

Now, I want to access my remote server in a Bitbucket Pipeline via:

ssh -T user@XX.XX.XX.XX rm testfile

But I stuck on that:

Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).

 

Where is the fault that I cannot access my remote server to execute the command?

 

Thanks a lot

3 answers

1 accepted

1 vote
Answer accepted

Hi Max,

Can you try do a quick check that the connection works:

$ ssh -qT user@downhost exit
$ echo $?
// Should be 0

Your user may not have permission to modify files, so it'll be good to remove that factor first. If you get a 0, then double check the permissions of the user you're SSH'ing as.

If not, you can also double check you have whitelisted the necessary Pipelines IP's.

Thanks,

Phil

Hi Philip,

Im having this same issue, i ran the commands you stated and i got a 0, but i still get the permission denied error. Please any suggestions what might be wrong?

@Olusiji David,

Can you try run this instead. I forgot there's an edge case with the way error codes work.

$ ssh -qT user@downhost exit; echo $?

Thanks

Hi Philip,

Where exactly is this command to be executed? In the bitbucket-pipelines.yml file or on the  remote computer? Do I have to customize user@downhost or leave it in the command?

$ ssh -qT user@downhost exit
$ echo $?
// Should be 0

 

When I run this on the remote computer I get a value of 255. What should I do afterwards?

Sorry for the many questions, but I am still a beginner in the field.

Thanks,

Sebastian 

I struggled with this for a day and followed all the comments without it working.

The one thing that eventually worked for me was letting bitbucket create the private and public keys and using those instead of the ones I created myself. 

I then added the public key (as it says ) to the server's `~/.ssh/authorized_keys` file (as a new line) 

It all then worked.

Thank you, helped me a lot!

Thank you! Works for me!

Also worked for me too

Hello.. how do i let bitbucket create the ssh. i not that good with Atlassian products

@John Kabiu 

On the repository -> Repository Settings -> Scroll to Pipelines / SSH keys -> Generate

For me, the problem was at the target server. I needed to set `chmod 0775 ~/.ssh` so the server started accepting the SSH auth for the user.

Suggest an answer

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

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

505 views 6 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