linux下设置 git ssh 代理

Posted 跬步者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux下设置 git ssh 代理相关的知识,希望对你有一定的参考价值。

/root/.ssh (以下为 root权限的操作)

1. 生成key.

$ ssh-keygen

一路回车,直到生成 id_rsa, id_rsa.pub

1.1 chmod 400 id_rsa.pub

 

2. 修改 /etc/ssh/ssh_config 文件 (root用户) //普通用户 vim ~/.ssh/config (没有则新建文件)

增加

Host github.com *.github.com
   ProxyCommand connect-proxy -H web-proxy.oa.com:8080 %h %p   #设置代理
   IdentityFile ~/.ssh/id_rsa
   User git

 

3. 安装 connect-proxy

3.1. rpm文件下载

http://rpm.pbone.net/index.php3?stat=3&search=connect-proxy&srodzaj=3

3.2. rpm的安装

http://www.discuz.net/thread-3513163-1-1.html

 

4.1 把你的 id_rsa.pub (空格,什么都不能动,原样copy到 git的ssh key 设置)

测试验证

5.  ssh -v -T [email protected]

 

以上是关于linux下设置 git ssh 代理的主要内容,如果未能解决你的问题,请参考以下文章