Git配置非22端口,解决:ssh: connect to host xxx port 22: Connection timed out fatal: The remote end hung up unexpectedly
背景:私自搭建了Git服务器,而Git本身就是SSH进行连接的,而Git命令上默认只能通过22端口实现。
解决方法:
第一种:
在系统的用户目录下的文件夹:.ssh
如果该路径下没有config文件,则创建一个。
config中添加如下内容:
如是以域名访问的则添加如下内容:(注意修改xxx为你的远程仓库的名称)
Host xxx
HostName xxx.com
Port 3333
如是以IP访问的,则添加如下内容:(注意修改IP为你的远程仓库IP)
Host "211.111.xx.xxx"
Port 3333
第二种:
Git本身基于SSH的,所以直接使用SSH的写法来增加自定义端口号
git clone ssh://git@domain.com:3022/~/Projects/p1.git
参考:
http://blog.csdn.net/u010041075/article/details/52981731
http://blog.csdn.net/daiwood/article/details/50561306
Git配置非22端口,解决:ssh: connect to host xxx port 22: Connection timed out fatal: The remote end hung up unexpectedly的更多相关文章
- 新手git: ssh: connect to host localhost port 22: Connection refused
由于gitlab上要git pull或者git clone,可是每次都出现这个问题.之前偶尔出现这个问题.可是仅仅是偶尔.这是为什么呢?然后就開始搜索网上的解决方式了. 这个问题搜索网上非常多答案.可 ...
- ssh本机失败(ssh: connect to host localhost port 22: Connection refused)
ssh本机失败(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 ...
- 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 master port 22: Connection refused
hadoop集群启动的时候namenode显示Connection refused 到windows下ping master 显示传输中过期 ip是静态的 ssh master 也是连接拒绝 重启s ...
- 解决osx下 ssh: connect to host localhost port 22: Connection refused
解决办法: 终端下执行:sudo systmesetup -setremotelogin on
- <Linux> Ubuntu error: ssh: connect to host master port 22: No route to host lost connection
iptables当找到匹配的规则时,就会执行相应的动作,而不会向下继续匹配.因为ssh端口开放的规则在all规则之后,所以永远都不会匹配到,也就是ssh永远被禁止. root下执行:iptables ...
- 使用ssh localhost命令,发生异常ssh: connect to host localhost port 22: Connection refused
使用"ssh localhost"命令,失败: 问题分析如下: 出现这个问题是因为Ubuntu默认没有安装openssh-server.检查是否安装了openssh-server, ...
随机推荐
- 健身VS不健身,完全是两种不同的人生!
这两天一组同龄人合照 刷爆了国内健身圈, 图左是一位67岁的老人, 图右是67岁的健美运动员杨新民老师 相同年龄, 但从外观上有着强烈的距离感! 让多人不禁感叹,健身和不健身, 简直就是两种状态,两种 ...
- CTSC 2017 游记
惨啊,弱菜选手只报上了CTSC,去不了APIO. day -1 晚上的时候,坐上了去帝都的卧铺. 由于第二天就是luogu月赛round1,还得在火车上赶工出题... 颓了好长时间,把题面写出来了,用 ...
- Centos更新配置文件命令
source 命令是 bash shell 的内置命令,从 C Shell 而来.source 命令的另一种写法是点符号,用法和 source 相同,从Bourne Shell而来.source 命令 ...
- csu 1329 一行盒子(链表操作)
1329: 一行盒子 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 693 Solved: 134 [Submit][Status][Web Boa ...
- MQTT协议以及库函数说明
内容简介:之前我们写了一篇ESP8266AT指令的说明文档,在客户端连接上服务器之后,接下来便是网络通信.为此我们又写了这一片MQTT协议的说明文档,更加深层次的讲述了通信的原理.此文档只是我们在调试 ...
- 【51nod】1594 Gcd and Phi
题解 跟随小迪学姐的步伐,学习一下数论 小迪学姐太巨了! 这道题的式子很好推嘛 \(\sum_{i = 1}^{n} \sum_{j = 1}^{n} \sum_{d|\phi(i),\phi(j)} ...
- 一道js试题
直接上试题 <script type="text/javascript"> var output = '123js'; var object = { output : ...
- 初识 Fuzzing 工具 WinAFL
转:https://paper.seebug.org/323/ 初识 Fuzzing 工具 WinAFL 作者:xd0ol1(知道创宇404实验室) 0 引子 本文前两节将简要讨论 fuzzing 的 ...
- Wannafly挑战赛7 B - codeJan与旅行
题目描述 codeJan 非常喜欢旅行.现在有 n 个城市排在一条线上,并且 codeJan 的位置不和任何一个城市的位置重叠.codeJan 想要游览 m 个城市,同时因为时间是不断变化的,游览一个 ...
- 长沙理工大学第十二届ACM大赛-重现赛 G - 跑路ing
题目描述 vigoss18 辞职成功终于逃出了公司,但是没过太久,公司就发现vigoss18 的所作所为,于是派人来把他抓 回去. vigoss18 必须一直跑路,躲避公司的围捕.可以抽象的看成一个有 ...