新手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 ...
随机推荐
- 当Shell遇上了Node.js(转载)
转载:http://developer.51cto.com/art/201202/315066.htm 好吧,我承认,这个标题有点暧昧的基情,但是希望下文的内部能给不熟悉或不喜欢Shell或WIN平台 ...
- mybatis的二级缓存
在mybatis主配置文件里configuration标签里添加 <settings> <setting name="cacheEnabled" value=&q ...
- Python迭代器(斐波拉切数列实例)
将一个容器通过iter()函数处理后,就变成了迭代器.迭代器有2个魔法方法__iter__.__next__,一个迭代器必须实现__iter__,这个方法实际上是返回迭代器本身(return self ...
- 【Leetcode】376. Wiggle Subsequence
Description: A sequence of numbers is called a wiggle sequence if the differences between successive ...
- CSS命名规则和如何命名
CSS命名规则 头:header 内容:content/containe 尾:footer 导航:nav 侧栏:sidebar 栏目:column 页面外围控制整体布局宽度:wrapper 左右中:l ...
- Go Server Record
Centos Setup Go yum install glibc-headers gcc-c++ # 一键安装shadowsocks 1. wget --no-check-certificate - ...
- win7 64位装sql2000
1.运行不了安装程序 右击安装exe文件->属性->兼容性->以xp sp3兼容和管理员身份 2.安装过程中提示“被挂起”的故障 解决:打开注册表编辑器,在HKEY_LOCAL_MA ...
- 打包Python程序
我选择的是pyinstaller,(py2exe到目前为止只支持到Python3.4). 安装.如果能联网最后用pip.在cmd中输入pip install Pyinstaller.如果不能联网,可以 ...
- hadoop job history server
默认情况下是没有启动的,需要配置完后手工启动服务. 1. 修改mapred-site.xml,添加如下内容(cluster mode, RM) <property> <nam ...
- OpenCV边缘检测的详细参数调节
1. findCountours 转载于http://blog.sina.com.cn/s/blog_7155fb1a0101a90h.html findContours函数,这个函数的原型为: &l ...