Git ssh 连接被拒绝,格式如下
每当我在 .git/config 中使用以下内容
url = ssh://[email protected]:imageInfo.git
作为远程存储库时,我都会收到以下错误
ssh: connect to host port 22: Connection refused
fatal: The remote end hung up unexpectedly
,但如果在 git 之外使用以下内容,
ssh [email protected]
我的连接不会出现问题。 Git 还使用 .git/config 中使用的 gitosis 用户连接到同一服务器,
url = [email protected]:imageInfo.git
并且没有问题。
简而言之,我的 .git/config 文件看起来像这样,
[remote "production"]
url = ssh://[email protected]:imageInfo.git
url = [email protected]:imageInfo.git
有什么想法吗?
Whenever I use the following
url = ssh://[email protected]:imageInfo.git
in .git/config for a remote repo I get the following error
ssh: connect to host port 22: Connection refused
fatal: The remote end hung up unexpectedly
but if use the following
ssh [email protected]
outside of git I connect without a problem.
Git also connects to same server with a gitosis user using
url = [email protected]:imageInfo.git
in .git/config and it has not problems.
so to sum things up in short my .git/config file looks like this
[remote "production"]
url = ssh://[email protected]:imageInfo.git
url = [email protected]:imageInfo.git
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 SSH URL 格式错误 - 您可以使用
scp
样式语法,例如:... 或真正的 URL 形式,其中您需要
/
在主机之后而不是:
和绝对路径(我只能猜测),例如:git URLs 的文档 在这里,但是
kernel.org
目前已关闭,因此您可能需要查看缓存的版本此处。You have the format of the SSH URL wrong - you can either use the
scp
-style syntax, like:... or the true URL form, where you need a
/
after the host rather than a:
, and an absolute path, which I can only guess at, e.g.:The documentation for git's URLs is here, but
kernel.org
is down at the moment, so you may want to look at the cached version here.由于没有安装并运行 sshd 守护进程,我收到此消息。所以我做了'sudo apt-get install ssh',问题就解决了。
I got this message due to not having sshd daemon installed and running. So I did 'sudo apt-get install ssh' and the issue was solved.