BAMBOO-SSH-PROXY: [While connecting to [git@stash-baseURL/]: Authenticating remote session failed


アトラシアン コミュニティをご利用ください。



The following scenario was tested with Bamboo 5.6.0 and Stash 3.2 versions, where the application links between the applications are set up and working correctly.

No problem was thrown on adding a "Linked repository" with Repository host as Stash in Bamboo under "Bamboo administration >> Build resources >> Linked repositories" or adding the linked repository to a "Plan configuration >> Repositories" tab.

Once the build plan runs, the following appears in the atlassian-bamboo.log:

(com.atlassian.bamboo.repository.RepositoryException : java.lang.RuntimeException: com.atlassian.bamboo.plugins.stash.repository.StashRepositoryException: com.atlassian.bamboo.repository.RepositoryException: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote ssh://22bc3160-b4f8-4024-bf38-48cc6b1b2e78@ failed with code 128. Working directory was [.]., stderr: Authenticating remote session failed stdout: [Warning: Permanently added '[]:56335' (RSA) to the list of known hosts., BAMBOO-SSH-PROXY: [While connecting to [git@stash-baseURL/]: Authenticating remote session failed], fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.])

Please, notice that port number 22 is in use instead of 7999 by default from Stash.



In Stash, under "Stash Administration >> Settings >> Server Settings", please notice the port number 7999 is missing from SSH base URL


In order to fix this issue, append SSH port (:7999) to the SSH base URL. As a result, you would have ssh://

After saving the changes in Stash, it is time to update your repository on Bamboo as per the following:

  1. go to "Bamboo administration >> Build resources >> Linked repositories" and select your Stash repository.
  2. Hit the "Save repository" button
  3. and go to the "Plan configuration >> Repositories" tab.
  4. Please make sure that Stash is configured as a Repository host and hit "Save repository."
  5. Run your build plan.

Other problems

Note: If you still face issues after changing the SSH Base URL, please check your Proxy, Firewall configurations. 

You may also see errors like those below. You could perform basic checks to see whether Bamboo server or the agents could reach the configured Bitbucket server.

Remote connection failed
 BAMBOO-SSH-PROXY: [SSH proxy tried to connect to []: and failed due to the following error: [Remote connection failed]: Failed to get the session.] 

For example, commands like ssh or telnet to port 7999 of Bitbucket server.

Connectivity checks to Bitbucket
ssh -p 7999 -v 

telnet 7999

最終更新日 2023 年 6 月 8 日


Powered by Confluence and Scroll Viewport.