システム用の SSH アクセス キー
- 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.
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
Now, in Bitbucket, go to the Settings tab for the project or repository.
[アクセス キー] > [キーの追加] の順にクリックします。
- 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 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 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. 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 アクセス キーを複数のリポジトリまたはプロジェクトで使用できます。
- 個人ユーザー アカウント用に使用されているキーを、プロジェクトまたはリポジトリ システムのアクセス キーとして再使用することはできません。また、プロジェクトまたはリポジトリのアクセス キーとして使用されているキーをユーザー アカウントに再使用することはできません。
アクセス キーの削除
リポジトリの [設定] > [アクセス キー] に移動し、キーのプラス記号 (プラス記号はカーソルを重ねたときにのみ表示されます) に移動してアクセス キーを削除できます。
キーが複数のプロジェクトまたはリポジトリで使用されている場合は、キーの削除元となるその他の場所を選択できます。
ダイアログには、ユーザーが閲覧権限を持つプロジェクトとリポジトリのみが表示される点にご注意ください。ダイアログに記載されていない別の場所でキーが使用されている可能性があります。キーのすべての使用を確実に削除する場合、管理者またはシステム管理グローバル権限を持つユーザーがこの操作を実行する必要があります。