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, ...
随机推荐
- Linux内核同步原语之原子操作
避免对同一数据的并发访问(通常由中断.对称多处理器.内核抢占等引起)称为同步. ——题记 内核源码:Linux-2.6.38.8.tar.bz2 目标平台:ARM体系结构 原子操作确保对同一数据的“读 ...
- Ubuntu 14.04 64位上安装wps office软件(转http://m.blog.csdn.net/blog/yhc13429826359/24179933)
废话少说,只给出方法供各位参考!wps for Linux版本已经有两三年没有大的动作,当然其他平台,比如windows,Android,ios上的wps效果还是很赞的说. 下面是我成功安装的步骤: ...
- 简单实现JS上传图片预览功能
HTML代码 <div class="upload"> <input type="button" class="btn" ...
- Codeforces Round #456 (Div. 2)
Codeforces Round #456 (Div. 2) A. Tricky Alchemy 题目描述:要制作三种球:黄.绿.蓝,一个黄球需要两个黄色水晶,一个绿球需要一个黄色水晶和一个蓝色水晶, ...
- 登陆记录utmp wtmp
/var/log/wtmp文件的作用 /var/log/wtmp也是一个二进制文件,记录每个用户的登录次数和持续时间等信息. 查看方法: 可以用last命令输出当中内容: debian ...
- Percona XtraDB Cluster(PXC) -集群环境安装
Percona XtraDB Cluster(PXC) ---服务安装篇 1.测试环境搭建: Ip 角色 OS PXC-version 172.16.40.201 Node1 Redhat/C ...
- SimpleCV install and "You need the python image library to save by filehandle"
2015年5月3日 22:15:43 在win7下安装了python.simplecv,试着运行simplecv官网第一个hello world程序结果报错,提示说%python%/lib/site- ...
- 一个简单的AboutMe页面
Web2.0程序设计的小练习. Firefox下的效果 Chrome下的效果,套上了Helvetica,不知道为什么FF没有 (其实好像应该再优先加个Helvetica Neue的……呃……) 代码和 ...
- Python/Anaconda多版本共存的解决方案
博客中的文章均为 meelo 原创,请务必以链接形式注明 本文地址 虽然Python2大势已去,众多项目都已经支持Python3,但总有一些教程和项目只支持Python2.通常情况是计算机里既装着Py ...
- 【洛谷】P4585 [FJOI2015]火星商店问题
题解 题目太丧,OJ太没有良心,我永远喜欢LOJ! (TLE报成RE,垃圾洛谷,我永远喜欢LOJ) 好的,平复一下我debug了一上午崩溃的心态= =,写一写这道题的题解 把所有限制去掉,给出一个值, ...