aaaiiuie

学習(備忘録)のため運用

backlogリポジトリとgithubリポジトリを両方使うときのconfig設定

backlogリポジトリとgithubリポジトリを両方使う場合のcofigの設定を備忘録として以下に記載。

| 鍵作成

## 組織
$ ssh-keygen -t rsa -C '●●●●●●@example.com' -f ~/.ssh/id_rsa_backlog_company
## 個人
$ ssh-keygen -t rsa -C '●●●●●●@private.com' -f ~/.ssh/id_rsa_github_private

| 鍵を登録

公開鍵を各サービス設定画面に登録する

$ pbcopy < ~/.ssh/id_rsa_backlog_company.pub
$ pbcopy < ~/.ssh/id_rsa_github_private.pub

| configファイル

なければ .ssh 直下に作成

$ vim config

Host github.com
  User git
  HostName github.com
  IdentityFile ~/.ssh/id_rsa_github_private
  IdentitiesOnly yes

Host ●●●●●●.git.backlog.jp
  User ●●●●●●
  HostName ●●●●●●.git.backlog.jp
  IdentityFile ~/.ssh/id_rsa_backlog_company
  IdentitiesOnly yes

確認する

$ ssh -T git@github.com
Hi ●●●●●●! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh -T ●●●@●●●.git.backlog.jp
Hi ●●●●●●! You've successfully authenticated, but Backlog does not provide shell access.