2016-09-09 11 views
0

私は個人用と仕事用の2つのbitbucketアカウントを持っています。私の個人的なものはうまく働いていて、私が仕事で使うものもうまくいきます。しかし、私は自宅から仕事に接続できるようにしたいと思っていましたが、動作させるのに問題があります。エイリアスを使用してBitBucketで複数のsshキーを使用することはできません

私のファイルが呼び出されます。私の設定ファイルとしてある

## Unrelated ones I use for plan.io that still work 

id_rsa 
id_rsa.pub 

## Personal one for bitbucket I just created because of seperation 

homeid 
homeid.pub 

## Work one for bitbucket 

workid 
workid.pub 

:今、私は別名でクローニングを行う方法で少し混乱しました

Host [email protected] 
HostName bitbucket.org 
IdentityFile ~/.ssh/homeid 


Host [email protected] 
HostName bitbucket.org 
IdentityFile ~/.ssh/workid 

が、試しました:

git clone [email protected]:my-username/myrepo.git 

しかし、それはエラーメッセージで失敗します。

Cloning into 'myrepo'... 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

私は私がここで間違ってやっているそうではないことを確認、適切なビットバケットアカウントにブリックキーを追加していますか?

答えて

0

ホスト[email protected]

ssh_configHostディレクティブは構文 "@ユーザー名" を受け付けません。代わりにMatchディレクティブを使用してください。

+0

どうすればクローンを作成できますか? 'git clone [email protected]:my-username/myrepo.git'? – Brett

0

よく働いています。

私が間違っgitのクローンアドレスを使用していた

、正しいものビーイング:

git clone [email protected]:my-username/myrepo.git 

...だけでなく、ホスト変更するには、以下に私の設定ファイルを変更する必要がありました:

Host homeid 
HostName bitbucket.org 
IdentityFile ~/.ssh/homeid 


Host workid 
HostName bitbucket.org 
IdentityFile ~/.ssh/workid 
関連する問題