新手git: ssh: connect to host localhost port 22: Connection refused
由于gitlab上要git pull或者git clone,可是每次都出现这个问题。之前偶尔出现这个问题。可是仅仅是偶尔。这是为什么呢?然后就開始搜索网上的解决方式了。
这个问题搜索网上非常多答案。可是试过去都不行。
第一个是说openssh-server没有安装,由于我的电脑是mac,ps -e |grep ssh已经看到安装而且执行了。可是还是不行;
第二个方案说的是新建~/.ssh/config然后输入几行代码,这个也不行。
最后实行要崩溃了才发现我的clone链接是:git@xxxxx:xxxxxxx/xxxxxxxxx.git这样的类型的,我之前用的都是http://开头的,所以就试了一下:http://xxxx/xxxx/xxxxx.git这样的类型的链接,果然成功了。没有出现:ssh: connect to host localhost port 22: Connection refused了。
当中的原因能够看git的原理。有几种协议能够为git url。公司内网或者防火墙问题可能使得我不能使用:git@xxxxx:xxxxxxx/xxxxxxxxx.git这样的形式,只是我先用外网试验再说吧,高手能够教教我,我还是git亲手……
Git URL可能以ssh://, http(s)://, git://,或是仅仅是以一个username(git 会觉得这是一个ssh 地址)为前辍.
而我之前用的链接是什么忘了,可能是混着用,所以偶尔出现这个问题。
新手git: ssh: connect to host localhost port 22: Connection refused的更多相关文章
- 运行Hadoop start-all.sh遇到的错误ssh: connect to host localhost port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused 我的情况是ssh server没装,查看方法: ps -e |grep ssh 1 ...
- ssh: connect to host localhost port 22: Connection refused
1.hadoop安装好之后,执行ssh localhost无法执行, 提示“ssh: connect to host localhost port 22: Connection refused”. 2 ...
- ssh本机失败(ssh: connect to host localhost port 22: Connection refused)
ssh本机失败(ssh: connect to host localhost port 22: Connection refused) 一. 问题描述 之前一直在服务上使用宝塔面板, 今天突发奇想, ...
- Ubuntu下 ssh : connect to host localhost port 22:Connection refused
Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因 ...
- ssh: connect to host localhost port 22: Connection refused 问题
错误原因:1.sshd 未安装2.sshd 未启动 3.防火墙 4需重新启动ssh 服务 解决方法:1.确定安装sshd: $ sudo apt-get install openssh-server ...
- 使用ssh localhost命令,发生异常ssh: connect to host localhost port 22: Connection refused
使用"ssh localhost"命令,失败: 问题分析如下: 出现这个问题是因为Ubuntu默认没有安装openssh-server.检查是否安装了openssh-server, ...
- 解决osx下 ssh: connect to host localhost port 22: Connection refused
解决办法: 终端下执行:sudo systmesetup -setremotelogin on
- mac connect to host localhost port 22: Connection refused
在Mac OS X 10.10.5学习hadoop的过程中,输入命令ssh localhost得到 ssh: connect to host localhost port : Connection r ...
- ssh: connect to host master port 22: Connection refused
hadoop集群启动的时候namenode显示Connection refused 到windows下ping master 显示传输中过期 ip是静态的 ssh master 也是连接拒绝 重启s ...
随机推荐
- VBA 字符串处理函数集
转自:http://blog.csdn.net/jyh_jack/article/details/2315345 mid(字符串,从第几个开始,长度) 在[字符串]中[从第几个开始]取出[长度个字符 ...
- AMD 与 CMD 区别
作者:玉伯链接:https://www.zhihu.com/question/20351507/answer/14859415来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出 ...
- 分享的js代码,从w3c上拓下来的
<!DOCTYPE html><html><head> <title></title> <script>window._bd_s ...
- 1961 躲避大龙(dfs)
1961 躲避大龙 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题目描述 Description 你早上起来,慢悠悠地来到学校门口,发现已经是 ...
- 正确的缩写document。querySelector
北京的夕阳,伴随淡淡的霾殇.从写字楼望去,光线是那么昏黄.没有孤雁,也没有霞光,遥想当年,还是 jQuery 独霸一方.那时的我们,写程序都习惯了使用 $,至少在对美元符号的喜爱上,与 PHP 达成了 ...
- python请求服务器图片并下载到本地磁盘
>>> import os >>> os.getcwd() 'C:\\Python33' >>> os.chdir('E:\\python\\mm ...
- css样式变 及实际用法
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Con ...
- Android 新浪微博开放平台应用 android签名怎么获得
方法一: 通过命令行,直接生成MD5值 keytool -list -v -keystore keystorefile -storepass 其中keytool为jdk自带工具:keystorefil ...
- [Intermediate Algorithm] - Drop it
题目 队友该卖就卖,千万别舍不得. 当你的队伍被敌人包围时,你选择拯救谁.抛弃谁非常重要,如果选择错误就会造成团灭. 如果是AD或AP,优先拯救. 因为AD和AP是队伍输出的核心. 其次应该拯救打野. ...
- html formData 数据 提交和 .netMVC接收
<form id="uploadForm" enctype="multipart/form-data"> <input type=" ...