システム用の 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 操作を許可できます。
  • これらはシステム アクセス用に設計されているため、"Verify Commit Signature" フックが有効化されていても、GPG キーで署名されていないコミットが SSH アクセス キーによってプッシュされる場合があります。

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

アクセス キーの削除

リポジトリの [設定] > [アクセス キー] に移動し、キーのプラス記号 (プラス記号はカーソルを重ねたときにのみ表示されます) に移動してアクセス キーを削除できます。


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

ダイアログには、ユーザーが閲覧権限を持つプロジェクトとリポジトリのみが表示される点にご注意ください。ダイアログに記載されていない別の場所でキーが使用されている可能性があります。キーのすべての使用を確実に削除する場合、管理者またはシステム管理グローバル権限を持つユーザーがこの操作を実行する必要があります。

最終更新日 2022 年 7 月 6 日

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

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