【问题标题】:GIT - msysgit wont ask for passwordGIT - msysgit 不会要求输入密码
【发布时间】:2012-12-13 00:47:14
【问题描述】:

我有一个远程 GIT 存储库 (ubuntu),并且在 Windows 7 上本地工作。我运行良好,并设置了 SSH 密钥。在这个过程中的某个时刻,我似乎禁用了 GIT/msysgit 询问密码。我现在有一个没有密钥设置的新远程 git repo(在 ubuntu 上),它不会询问我的密码。我试过了

git clone ssh://<user>:<pass>@<ip>:<myport>/mygitrepopath

它也不起作用。但我可以使用具有相同凭据的 putty 登录。

编辑

这是我收到的信息

Cloning into 'myhub'...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa blah blah blah
Connection abandoned.
fatal: The remote end hung up unexpectedly

【问题讨论】:

  • 怎么不工作?会发生什么?

标签: git ssh msysgit


【解决方案1】:

我认为您不会将ssh://user:password@host URL 一起使用。

如果删除您的 known_hosts 文件不起作用 (rm ~/.ssh/known_hosts),请尝试将 ssh-rsa blah blah blah 行添加到该文件(如果您刚刚删除它,请创建它,他)。

这应该会有所帮助。

应该有一个选项可以让 git/ssh 不中止与未知主机的连接,但我不知道。

【讨论】:

  • 是从 Windows(客户端)或 Ubuntu(服务器)中删除主机吗?过去我成功使用了语法 @ 但它通常要求输入密码
  • @neolaser ssh://user@host 是有效的,ssh://user:password@host 我认为不是。你必须从客户端做主机的事情。更具体地说,来自 Git Bash,因此它可以正确解释 ~
猜你喜欢
  • 1970-01-01
  • 2014-04-26
  • 2021-03-29
  • 2014-12-18
  • 2014-07-30
  • 2021-11-24
  • 2017-11-10
  • 1970-01-01
相关资源
最近更新 更多