我有一个Bitbucket帐户,我的9-5工作,我也有一个个人Bitbucket帐户.我的目标是能够在同一台计算机上使用它们.我在Windows 7上安装了最新的git.
所以目前我公司Bitbucket帐户的一切工作正常,我可以拉/推没有问题.我使用ssh-keygen创建了一个新的ssh密钥,并在我的案例"tech"中分配了一个新名称.但我遇到了如何告诉本地仓库使用我创建的新ssh密钥的问题.我假设每次我尝试连接它使用第一个ssh键.
我收到错误:
$ git push conq:存储库访问被拒绝.致命:远程端意外挂断
我在互联网上找到了一些建议,但它似乎与linux/git设置有关,例如我在Windows上找不到"config"文件.
1)运行Git Bash(C:\ Program Files(x86)\ Git\bin\sh.exe --login)
$ ssh -v git@github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Users/Alexander Fedorov/.ssh/config
debug1: Applying options for github.com
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
...
Hi xpoft! You've successfully authenticated, but GitHub does not provide shell access.
...
Run Code Online (Sandbox Code Playgroud)
好的!ssh配置好读.
2)从cmd.exe运行
C:\Users\Alexander Fedorov>ssh.exe -v git@github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [207.97.227.239] port 22.
...
debug1: No more authentication methods to try.
Permission denied …Run Code Online (Sandbox Code Playgroud)