新手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 ...
随机推荐
- layui日期输入框
<div class="layui-form-item"> <label class="layui-form-label& ...
- 有关于dict(字典)的特性与操作方法
有关于dict(字典)的特性与操作方法 1.字典的特性 语法: dic = {key1 : value1,key2 : value2,key3 : value3............} 注:字典中k ...
- IntelliJ IDEA/PyCharm/WebStorm 2019.1.2 注册码激活
[IDEA2019.1.2最新版版本激活,直接查看底部] 网上IntelliJ IDEA激活方式大多均已失效,目前常用激活方式为License Server 激活: http://idea.imsxm ...
- .net core2.0 读取appsettings.json
一.在start.up中添加注入 二.使用
- javascript事件绑定1-模拟jquery可爱的东西
1.给对象添加事件attachEvent(兼容IE,不兼容ff.chrome) <html xmlns="http://www.w3.org/1999/xhtml"> ...
- Leetcode0024--Swap Nodes in Pairs 链表配对交换
[转载请注明]http://www.cnblogs.com/igoslly/p/8707274.html 来看一下题目: Given a linked list, swap every two adj ...
- javascript中计算点击多少次
点击事件:onclick <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...
- OpenCV向JNI层的参数转换
九层之台,起于累土:千里之堤毁于蚁穴:成者半于九十.最近工程项目完全可以调试,却最后在 OpenCV向JNI层的参数转换 这个节点上遇到麻烦,看来得好好的思考一番,仔细寻找其中的纰漏. 一.实例 根据 ...
- 浅谈 Unserscore.js 中 _.throttle 和 _.debounce 的差异
来源:http://blog.coding.net/blog/the-difference-between-throttle-and-debounce-in-underscorejs Unsersco ...
- MVC返回400 /404/...
return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //HttpStatusCode statusCode 枚举 // HttpSt ...