新手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 ...
随机推荐
- Candies(差分约束系统)
http://poj.org/problem?id=3159 思路:用O(V+ElogV)的Dijkstra算法求1到n的最短路.即用优先队列优化Dijkstra算法. #include <st ...
- mysql出错代码
1005:创建表失败 1006:创建数据库失败 1007:数据库已存在,创建数据库失败 1008:数据库不存在,删除数据库失败 1009:不能删除数据库文件导致删除数据库失败 1010:不能删除数据目 ...
- [JZOJ3809]设备塔
其实我并没有JZOJ的号...但既然dalao说了是JZOJ上的题,那就是了吧...... 为了封印辉之环,古代塞姆利亚大陆的人民在异空间中建造了一座设备塔. 简单的说,这座设备塔是一个漂浮在异空间中 ...
- POJ 2286 The Rotation Game IDA*
(再一次感谢学长幻灯片) ID A* 随便自己yy了一下. 额嗯 思路什么的都没有问题 就是改不对.. 无奈地删代码...边删边交. 删啊删 哎呦 AC了 ... ... ... 找删的那一段 . o ...
- POJ 1985 求树的直径 两边搜OR DP
Cow Marathon Description After hearing about the epidemic of obesity in the USA, Farmer John wants h ...
- android开发 设备调试问题
如果在mac下面用趁机开发android程序,发现不能连接上时就需要进行简单设置即可 先设置Finder为可以显示所有隐藏文件夹: 打开终端,输入如下命令: 显示Mac隐藏文件的命令:defaults ...
- C#之经理评分系统
PM类,几乎全是属性 using System; using System.Collections.Generic; using System.Linq; using System.Text; usi ...
- Oracle 关于oracle自带的行转列函数
前言: 环境是java+hibernate+oracle11g 目标是将某表中根据id分组后将name字段的值拼接到一列中,且用“,“进行分割 试过用 wm_concat() 结合 group by ...
- Android第三方微博、无线传输、动画特效、商城应用等源码
Android精选源码 Android汽车助手源码 一个酷炫的Android特效源码 新浪微博的第三方客户端.UI遵循Material Design. Android实现旋转木马布局多种效果 Andr ...
- DeltaFish 校园物资共享平台 第四次小组会议
一.上周记录汇报 齐天扬 学习慕课HTML至14章.构建之法10-14章 李 鑫 学习制作简易的JSP页面和servlet,看完关于HTML的慕课 陈志锴 学习编制简易JSP页面和servlet, ...