2016-08-27 10 views
0

Bitbucketで2番目のアカウントを設定するだけで、最初のアカウントと同じように水銀で使用しています。私は指示hereに従ってきた、そしてので、私の~/.ssh/configファイルは次のようになります。今異なるIDを持つMercurialでBitBucketにSSHを実行できない

UserKnownHostsFile /dev/null 
StrictHostKeyChecking no 
ForwardAgent yes 

Host bitbucket.org 
HostName bitbucket.org 
PreferredAuthentications publickey 
IdentityFile ~/.ssh/id_rsa 

Host bitbucket.org 
HostName bitbucket.org 
PreferredAuthentications publickey 
IdentityFile ~/.ssh/personal 

、私は、ファイルの最初のアイデンティティを持つSSH、および第二のために私が取得することができます。

remote: conq: repository access denied. 
abort: no suitable response from remote 

configファイルの2つのアイデンティティを切り替えると、前にはできなかったものを使ってアクセスすることができ、その逆もあります。私は間違って何をしていますか?

+0

[単一のhgリポジトリ用に複数のssh IDを設定するにはどうすればいいですか?](http://stackoverflow.com/questions/4833289/how-to-setup-multiple-ssh-identities-for-single-hg-リポジトリ) – Jakuje

答えて

1

変更.ssh/configのホスト別名:

の.ssh/configに

Host bitbucket1 
HostName bitbucket.org 
PreferredAuthentications publickey 
IdentityFile ~/.ssh/id_rsa 

Host bitbucket2 
HostName bitbucket.org 
PreferredAuthentications publickey 
IdentityFile ~/.ssh/personal 

使用法は、任意のSSHのエイリアスを使用することができます

# will use the ~/.ssh/id_rsa identity 
hg clone ssh://[email protected]/your/repository 

# will use the ~/.ssh/personal identity 
hg clone ssh://[email protected]/your/repository 

、唯一重要なこと異なるアイデンティティのためにそれらが異なっているということです。したがって、最初の入力にはHost bitbucket.orgを保存し、もう1つをHost personal.bitbucket.orgに変更することができます。

関連する問題