付録A 複数の SSH キーを異なるドメイン/プロジェクトに使用する
Red Hat Mobile Application Platform ホスト型 (RHMAP) 内の複数のドメインに異なるユーザーとしてアクセスする必要がある場合は、Git レポジトリーにアクセスする際に別の SSH キーを使用する必要があります。各 SSH キーは単一ユーザーとの関連付けのみが可能であるためです。各ホストに適用するキーを Git/SSH に指示する必要があります。これは通常、SSH 設定ファイルを使用してセットアップします。
SSH は通常、利用可能なすべての ID ファイルの使用を試み、クラスター内でいくつかの ssh キーが有効である場合は、そのクラスターで有効でかつクローンしようとしているプロジェクトにアクセスがないキーを使用する可能性があります。
ローカルの SSH 設定ファイルは通常 ~/.ssh/config で、これを更新すると特定ホストに使用する ID を一覧表示できますが、IdentitiesOnly yes 句を追加して、すべての ID ファイルを使用するのではなく、特定ホストに指定された ID ファイルのみを使用するよう SSH に指示する必要もあります。
たとえば、アプリのリポジトリーに 2 人の別のユーザーとしてアクセスしたい場合は、それぞれのユーザーに SSH キーを作成し、それを対応するユーザーアカウントにアップロードします。
下記の例では、SSH キーファイル /Users/jbloggs/.ssh/key_for_domain1_id_rsa が domain1.redhatmobile.com のユーザーに、/Users/jbloggs/.ssh/key_for_domain2_id_rsa が domain2.redhatmobile.com のユーザーにアップロードされています。
アプリのレポジトリーへのアクセスを許可するには、以下のようにします。
git@domain1.redhatmobile.com:domain1/jbAdvTest-mmCord1.git git@domain2.redhatmobile.com:domain2/jbAdvTest-mmCord2.git
ssh 設定ファイルは以下のようになります。
Host domain1.redhatmobile.com HostName domain1.redhatmobile.com IdentitiesOnly yes IdentityFile /Users/jbloggs/.ssh/key_for_domain1_id_rsa Host domain2.redhatmobile.com HostName domain2.redhatmobile.com IdentitiesOnly yes IdentityFile /Users/jbloggs/.ssh/key_for_domain2_id_rsa
これで以下の git コマンドを使用してレポジトリーをクローンできます。
git clone git@domain1.redhatmobile.com:domain1/jbAdvTest-mmCord1.git git clone git@domain2.redhatmobile.com:domain2/jbAdvTest-mmCord2.git
ssh 設定ファイルにより、適切な SSH キーが各ドメインに使用されます。ssh 設定に関する詳細情報は、SSH のローカルインストールについてのドキュメントを参照してください。お使いのオペレーティングシステムによっては、man ssh_config のコマンドで入手できる場合があります。
上記の設定およびドメイン名は例なので、実際のドメインとして使用しないでください。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.