システム用の SSH アクセス キー
Note that Bitbucket Server supports DSA, RSA2, and Ed25519 key types. RSA1 is not supported.
SSH キーを使用して Bitbucket Server との接続を保護する前に、次の手順を完了している必要があります。
- Bitbucket Server 管理者が Bitbucket Server でSSH アクセスを有効化している必要があります。
- Your Bitbucket administrator must already have enabled the option SSH access keys enabled on Bitbucket.
- SSL キーは作成済みであると見なされます。「SSH キーを作成する」を参照してください。Bitbucket Server の個人アカウントで使用していない既存のキーがある場合、それを使用することもできます。
SSH キーを使用して Bitbucket Server リポジトリへのアクセスを許可する
SSH キーがビルドまたは他のシステムで機能するようにするには、以下が必要です。
- 対象のシステムに非公開キーを追加します。Bamboo の場合、「共有される資格情報」のページを参照してください。
- 以降の説明にしたがって Bitbucket Server にパブリック キーを追加します。
Bitbucket Server のプロジェクトまたはリポジトリに SSH アクセス キーを追加する
アクセスを許可したいシステムからパブリック キーをコピーし、Bitbucket Server に貼り付けます。
Copy the public key. One approach is to display the key on-screen using
cat
, and copy it from there:cat < ~/.ssh/id_rsa.pub
次に、Bitbucket Server で、プロジェクトまたはリポジトリの [設定] タブに移動します。
[アクセス キー] > [キーの追加] の順にクリックします。
- Choose the Read permission, for
git pull
orgit clone
operations for example, where you want to be sure that the system will not be able to write back to the Bitbucket Server repository.
Choose the Read / Write permission, forgit push
orgit merge
operations for example, where you may want your build system to merge successful feature branch builds to the default branch in the Bitbucket Server 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. キーをテキスト ボックスに貼り付け、[キーを追加] をクリックします。
Bitbucket Server ライセンスについて
- システム アクセス キーには追加の Bitbucket Server ユーザー ライセンスは不要です。
アクセスキーの再使用
- 同じ SSH アクセス キーを複数のリポジトリまたはプロジェクトで使用できます。
- 個人ユーザー アカウント用に使用されているキーを、プロジェクトまたはリポジトリ システムのアクセス キーとして再使用することはできません。また、プロジェクトまたはリポジトリのアクセス キーとして使用されているキーをユーザー アカウントに再使用することはできません。
アクセス キーの削除
リポジトリの [設定] > [アクセス キー] に移動し、キーのプラス記号 (プラス記号はカーソルを重ねたときにのみ表示されます) に移動してアクセス キーを削除できます。
キーが複数のプロジェクトまたはリポジトリで使用されている場合は、キーの削除元となるその他の場所を選択できます。
ダイアログには、ユーザーが閲覧権限を持つプロジェクトとリポジトリのみが表示される点にご注意ください。ダイアログに記載されていない別の場所でキーが使用されている可能性があります。キーのすべての使用を確実に削除する場合、管理者またはシステム管理グローバル権限を持つユーザーがこの操作を実行する必要があります。
Note that Bitbucket Server supports DSA, RSA2, and Ed25519 key types. RSA1 is not supported.