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, ...
随机推荐
- cmder中文显示相关问题解决方案(1.3以上版本)
cmder虽然Windows命令行的进阶版,虽然好看易用,但其中文编码一直是个问题.网上有不少博客给出解决方案,大部分都已因为版本更新失效.本文解决方案针对1.3以上版本的cmder用户 中文字体重叠 ...
- 禁用quartz自动检查更新
禁用quartz自动检查更新的3种方法 1, <bean id="startQuertz" lazy-init="false" autowire=&quo ...
- python模块之xml.etree.ElementTree
xml.etree.ElementTree用于解析和构建XML文件 <?xml version="1.0"?> <data> <country nam ...
- 移动端touch滑屏事件
<script> var windowHeight = $(window).height(), $body = $("body");// console.log($(w ...
- 发布PHP项目(nginx+PHP7+mysql 5.6)
一.环境检查 1.检查nginx ps -ef | grep "nginx" 显示如下内容则代表nginx启动正常 root 3285 1 0 12:57 ? 00:00:00 n ...
- window下线程同步之(Event Objects(事件))
Event 方式是最具弹性的同步机制,因为他的状态完全由你去决定,不会像 Mutex 和 Semaphores 的状态会由类似:WaitForSingleObject 一类的函数的调用而改变,所以你可 ...
- 完美解决doc、docx格式word转换为Html
http://blog.csdn.net/renzhehongyi/article/details/48767597
- EasyUi – 5.修改$.messager.show() 弹出窗口在浏览器顶部中间出现
由于在easyui中$.messager.show() 只有一种弹出方式(在浏览器的或下角弹出),我最近在做一个项目的时候需要在浏览器的顶部中间出现.由于自己写花那么多的时间,所以就去修改了原码(不推 ...
- js 利用事件委托解决mousedown中的click
有一个需求是这样的: 父元素div绑定一个mousedown事件,子元素a绑定一个click事件. 看解构: <div id="nav"> <a href=&qu ...
- 【LOJ】#2351. 「JOI 2017/2018 决赛」毒蛇越狱
题解 没啥特别好的算法,是个讨论题,由于0 1 ?三类数位中最少的不会超过6 如果1不超过6,那么记录\(f1(S)\)为 \(\sum_{T \subset S} val(T)\)这个可以通过类似F ...