システム用の SSH アクセス キー

このページの内容

お困りですか?

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

コミュニティに質問

Bitbucket Data Center and Server administrators can set up SSH access keys to secure the Git operations that other systems perform on the repositories managed in Bitbucket. Using access keys avoids the need to store user credentials on another system, and means that the other system doesn't have to use a specific user account in Bitbucket.  For example, access keys can be used to allow your build and deploy server  to authenticate with Bitbucket to check out and test source code.

  • プロジェクト管理者はプロジェクトの SSH アクセス キーを追加および管理できます。キーはプロジェクト内の各リポジトリに適用されます。
  • リポジトリ管理者は特定のリポジトリの SSH アクセス キーを追加および管理できます。
  • アクセス キーは読み取り専用または読み取り / 書き込みの Git 操作を許可できます。
  • Because they are designed to be used for system access, SSH access keys may push commits that are not signed with a GPG key even if the "Verify Commit Signature" hook is enabled.


Bitbucket supports the following SSH key types:
  • ED25519
  • RSA2 (we recommend you use a key size of at least 2048 bits)
  • ECDSA
  • DSA (we recommend you use other key types)

Before you can use SSH keys to secure a connection with Bitbucket the following must have already been done: 

  • Your Bitbucket administrator must have already enabled SSH access, on Bitbucket.
  • Your Bitbucket administrator must already have enabled the option SSH access keys enabled on Bitbucket.
  • You must have already created an SSL key. See Creating SSH keys. Alternatively, you can use an existing key, if it isn't already being used for a personal account in Bitbucket.

Using SSH keys to allow access to Bitbucket repositories

SSH キーがビルドまたは他のシステムで機能するようにするには、以下が必要です。

  • 対象のシステムに非公開キーを追加します。Bamboo の場合、「共有される資格情報」のページを参照してください。
  • Add the public key to Bitbucket as described below.

Add an SSH access key to either a Bitbucket project or repository

You simply copy the public key, from the system for which you want to allow access, and paste it into Bitbucket.

  1. Copy the public key. One approach is to display the key on-screen using cat, and copy it from there:

    cat < ~/.ssh/id_ed25519.pub
  2. Now, in Bitbucket, go to the Settings tab for the project or repository.

  3. [アクセス キー] > [キーの追加] の順にクリックします。

  4. Choose the Read permission, for git pull or git clone operations for example, where you want to be sure that the system will not be able to write back to the Bitbucket repository.
    Choose the Read / Write permission, for git push or git merge operations for example, where you may want your build system to merge successful feature branch builds to the default branch in the Bitbucket repository, or so that deployments can be tagged. 
    Note that if you attempt to add a key already present on a project or repository but with a different permission to what it currently has, the permission will simply be updated.
  5. Paste the key into the text box and click Add key

     

Bitbucket license implications

  • System access keys do not require an additional Bitbucket user license.

アクセスキーの再使用

  • 同じ SSH アクセス キーを複数のリポジトリまたはプロジェクトで使用できます。
  • 個人ユーザー アカウント用に使用されているキーを、プロジェクトまたはリポジトリ システムのアクセス キーとして再使用することはできません。また、プロジェクトまたはリポジトリのアクセス キーとして使用されているキーをユーザー アカウントに再使用することはできません。

アクセス キーの削除

To delete an access key:

  1. Navigate to Repository Settings or Project SettingsAccess keys.
  2. Select More actions …. > Delete.

キーが複数のプロジェクトまたはリポジトリで使用されている場合は、キーの削除元となるその他の場所を選択できます。 

Note that the dialog only displays the projects and repositories that you have permission to see. Be aware that the key may also be used in other places that are not listed in the dialog. To be 100% sure that  all  uses of the key are deleted, this operation must be performed by someone with the administrator or sysadmin global permission .

最終更新日 2022 年 11 月 8 日

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

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