Centos7 - github ssh方式配置代理

配置php

# 生成公钥、私钥。把公钥上传至github上。
[root@compute01 ~]# ssh-keygen -t rsa  # 一路回车,默认私钥在~/.ssh/id_rsa

# 配置ssh代理
[root@compute01 ~]# cat ~/.ssh/config
Host github.com *.github.com
    ProxyCommand connect-proxy -H web-proxy.xxx.com:8080 %h %p
    IdentityFile ~/.ssh/id_rsa
    User git

# 测试
[root@compute01 ~]# ssh -T git@github.com  # 显示以下,说明ok
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.


tips: connect-proxy须要额外安装包,下载连接见:html

http://rpm.pbone.net/index.php3/stat/4/idpl/34752384/dir/redhat_el_7/com/connect-proxy-1.100-13.el7.x86_64.rpm.html git


参考连接github

https://www.chenyudong.com/archives/use-git-or-github-in-company-local-net.html web

https://www.chenyudong.com/archives/ssh-using-private-public-key-no-password.html shell

相关文章
相关标签/搜索