我试图设置git与http://danielmiessler.com/study/git/#website来管理我的网站。

我已经到了指令的最后一步:git push website +master:refs/heads/master

我正在win7中使用git ming32命令行工作

$ git push website +master:refs/heads/master
Bill@***.com's password:
Connection closed by 198.91.80.3
fatal: Could not read from remote repository.

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

这里的一个问题可能是程序正在寻找bill@* **.com。当我通过ssh连接到我的网站,我有一个不同的用户名(让我们说'abc')。也许这个应该是abc@***。com。如果是这样,我不知道如何改变这一点,或者如果我可以推下一个别名


当前回答

我在windows 10上使用gitbash时遇到了这个问题。我尝试了几种方法来解决这个问题,主要是:

重新创建我的ssh密钥并更新到bitbucket。没有帮助 打开调试使用这个,并发现我得到了“shell请求失败在通道0”,在这里询问 重启我的windows电脑

以上这些都没用。我最终为windows重新安装了Git,这只花了几分钟,与我所做的其他事情相比,它解决了问题!

其他回答

尝试使用未设置的GIT_SSH删除GIT_SSH环境变量。这就是我的问题所在。

我只是想补充一下这个问题。我有Git设置使用PLink和Pageant进行身份验证,我也得到了错误FATAL error: Disconnected:不支持可用的身份验证方法(服务器发送:publickey)。我已经打开了选美,但错误仍然显示。这个问题?我没有在Pageant中加载私钥(要添加密钥,请遵循以下说明)。就是这么简单。

我遇到这个问题是由于多次输入错误的密码。

所以我必须将MaxAuthTries更改为更大的数字:

在服务器端打开sshd_config:

vim  /etc/ssh/sshd_config

更改MaxAuthTries编号:

MaxAuthTries 100    # there I change to 100, you can change to a bigger than your current tries number

对我来说,问题和答案就写在我面前。当天早些时候,我编辑了/etc/ssh/ssh_config文件并添加了一些密钥。这个错误说:

/etc/ssh/ssh_config: line 52: Bad configuration option: allowusers
/etc/ssh/ssh_config: terminating, 1 bad configuration options
fatal: Could not read from remote repository.

我删除了allowusers键和它的值,一切都按照预期工作。

另一个解决方案:

有时这种情况发生在我身上是因为网络问题。我不完全理解根本问题,但是切换到不同的子网络或使用VPN可以解决这个问题