新手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 ...
随机推荐
- LocalDateTime查找最近的五分钟点
/** * 最近的五分钟 * @param dateTime * @return */ public static LocalDateTime getNear5(LocalDateTime dateT ...
- tpshop编辑框中上传图片过大变模糊
tpshop编辑框中上传图片过大变模糊 图片超过2500的高就会变模糊 设置最大的高度修改一下
- python修改植物僵尸
import win32process#进程模块 import win32con#系统定义 import win32api#调用系统模块 import ctypes#C语言类型 import win3 ...
- webapi时间字段返回格式设置及返回model首字母小写
GlobalConfiguration.Configuration.Formatters.Remove(new XmlMediaTypeFormatter()); // 解决json序列化时的循环引用 ...
- [原创]Linux(CentOS)下安装nodejs+express
网上找了很多步骤,各种问题,自己总结下吧 1.下载 wget --no-check-certificate https://nodejs.org/dist/v6.10.1/node-v6.10.1-l ...
- Java 入门作业
- Verification之PSL之use
1 Where can PSL be used? • Documentation – Requirements – RTL Designs • Controllers – Memories, FIFO ...
- 怎么不让别人ping服务器
频繁地使用Ping命令会导致网络堵塞.降低传输效率,为了避免恶意的网络攻击,一般都会拒绝用户Ping服务器.为实现这一目的,不仅可以在防火墙中进 行设置,也可以在路由器上进行设置,并且还可以利用Win ...
- matlab学习GUI可调的界面窗口
创建一个GUI界面,在此依然利用GUI_01的窗口来演示 发现它的最大化窗口不可调 在GUI绘制中,工具--->选择GUI选项---->选择第二个成比例 再运行就可以调控大小了
- PAT_A1127#ZigZagging on a Tree
Source: PAT A1127 ZigZagging on a Tree (30 分) Description: Suppose that all the keys in a binary tre ...