github的ssh通过http代理来配置实现
来源:互联网 发布:linux 查看tomcat日志 编辑:程序博客网 时间:2024/05/06 20:19
如果在公司内通过代理上网或者因为某些已知的非可抗力因素导致我们上网必须通过代理,用本地客户端访问github时,如果不做配置的话通过ssh来克隆repository的时候,用原生命令是不能直接访问的,需要配置下代理。
方法1. 配置ssh的配置文件
#回归家目录thinker@thinker-young MINGW64 ~/.ssh$ cd# 查看家目录在windows中的位置thinker@thinker-young MINGW64 ~$ pwd/c/Users/thinker#切到ssh的配置文件下thinker@thinker-young MINGW64 ~$ cd .ssh# 创建配置文件thinker@thinker-young MINGW64 ~/.ssh$ vi config#写入下面的内容#其中 10.80.22.24是代理服务器的地址,80是端口thinker@thinker-young MINGW64 ~/.ssh$ cat configHost github.comProxyCommand connect -H 10.80.22.42:80 %h %p#ProxyCommand ~/.ssh/ssh-https-tunnel %h %pPort 443Hostname ssh.github.com#保存退出thinker@thinker-young MINGW64 ~/.ssh
方法2.如果代理需要密码访问,可以用下面的方法
下载一个脚本放到.ssh目录下,命名为ssh-https-tunnel
下载地址:https://zwitterion.org/software/ssh-https-tunnel/ssh-https-tunnel
2.1 配置ssh的配置文件
#回归家目录thinker@thinker-young MINGW64 ~/.ssh$ cd# 查看家目录在windows中的位置thinker@thinker-young MINGW64 ~$ pwd/c/Users/thinker#切到ssh的配置文件下thinker@thinker-young MINGW64 ~$ cd .ssh# 创建配置文件thinker@thinker-young MINGW64 ~/.ssh$ vi config#写入下面的内容thinker@thinker-young MINGW64 ~/.ssh$ cat configHost github.comProxyCommand ~/.ssh/ssh-https-tunnel %h %pPort 443Hostname ssh.github.com#保存退出thinker@thinker-young MINGW64 ~/.ssh
2.2 配置代理服务器和密码
打开刚才下载ssh-https-tunnel这个文件,完成代理服务器ip和端口,及用户名和密码的配置:
################################## Start User Configuration ################################### Proxy detailsmy $host = "10.80.22.44";my $port = 80;# Basic Proxy Authentication - leave empty if you don't need itmy $user = "username";my $pass = "userpass";# Add an entry to your ~/.ssh/config that so "ssh remote.example.org"# uses this program to proxy the connection.## host remote.example.org# ProxyCommand /path/to/ssh-https-tunnel %h %p# Port 443# ServerAliveInterval 10## The last option enables Keep Alives to avoid the problem of many# proxies timing out inactive connections. Check your ssh client's# documentation for details.## If you are behind a Microsoft ISA server, or similar proxy that uses# NTLM, see http://www.google.com/search?q=ntlm+proxy+auth for ideas.################################## End User Configuration ##################################
如果是用的微软的NTLM认真的代理的话可以参考这位道友的文章:
http://blog.csdn.net/bluishglc/article/details/37600773
0 0
- github的ssh通过http代理来配置实现
- 成功通过http代理来使用github
- github配置ssh的时候如何使用浏览器代理
- linux通过http代理使用github
- github的SSH配置
- ssh通过http代理访问服务器
- SSH:通过EhCache来实现Hibernate的二级缓存
- git将本地项目通过SSH来 push 到自己的GitHub仓库
- 配置github上的ssh
- GitHub的SSH提交配置
- Github SSH key 的配置
- SourceTree通过配置SSH来链接GitLab
- 通过github来展示你的页面
- window上配置ssh来上传文件到github
- 通过ssh代理上网
- 通过xml配置来实现数据库的批量修改一
- GitHub中配置ssh遇到的问题解决
- 工具使用之Github的SSH配置
- 支付业务名词及释义大全
- 生成二维码
- android 中 系统日期时间的获取
- 深入理解requestAnimationFrame的动画循环
- Makefile中的常用函数介绍
- github的ssh通过http代理来配置实现
- perl socket 返回发送成功数据的长度
- datatable分页动态加载
- 【九度OJ】题目1087:约数的个数 解题报告
- Google Java Style 中文版
- DB2初学者学习
- Echarts海南地图过小解决方案
- Android WebView 跳转第三方App
- windows下面自动打包exe批处理