2016-08-27 1 views
0

그래서 Bitbucket에서 두 번째 계정을 설정 했으므로 첫 번째 계정과 마찬가지로 수은과 함께 사용하고 있습니다. 내가 지시 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 파일에서 두 ID를 전환하면 이전에 할 수 없었던 것을 사용하여 액세스 할 수 있으며 그 반대의 경우도 마찬가지입니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

+0

[단일 HG 저장소에 대해 여러 ssh ID를 설정하는 방법?] (http://stackoverflow.com/questions/4833289/how-to-setup-multiple-ssh-identities-for-single-hg- 저장소) – Jakuje

답변

1

변경 .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을 보존하고 다른 항목을 Host personal.bitbucket.org으로 변경할 수 있습니다.

관련 문제