Test Bitbucket Cloud service credentials

お困りですか?

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

コミュニティに質問


プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

要約

The purpose of this article is to test newly created service credentials to Bitbucket.  This will cover SSH keys and App Passwords.

Solution #1 - SSH keys

Here is the article to add the ssh key.

ssh -v -i ~/.ssh/<BBSSHKey> <UserName>@bitbucket.org

Replace <BBSSHKey> with the correct ssh key file and <UserName> with the right user name. 

Expected successful output

Bitbucket Cloud does not allow for any shell access, so if a terminal session asks for an interactive shell, it will terminate the output.  The test above requests by default the interactive session so we expect to get this error.

You can use git to connect to Bitbucket. Shell access is disabled

This is the error in context.

...
PTY allocation request failed on channel 0
authenticated via ssh key.

You can use git to connect to Bitbucket. Shell access is disabled
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to bitbucket.org closed.
Transferred: sent 2608, received 1936 bytes, in 0.1 seconds
Bytes per second: sent 25913.4, received 19236.3
debug1: Exit status 0
$

Solution #2 - App Password

Here is the article to create an Application Password.

curl -vvv -u "<username>:<appPassword>" "https://api.bitbucket.org/2.0/user"

Replace <appPassword> with the application password and <username> with your username listed in your Bitbucket profile settings.  Note that the App Password Label is not used in the REST calls.

Expected successful output

The call should get a http 200 and json with your users information.

* Connection state changed (MAX_CONCURRENT_STREAMS == 200)!
< HTTP/2 200
< server: nginx
...
<
{"display_name": ... "account_status": "active", "location": null}
説明 Test Bitbucket Cloud service credentials
製品Bitbucket Cloud
最終更新日: 2024 年 1 月 17 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.