通过代理

时间:2015-12-16 13:44:44

标签: linux git ssh proxy

我正在使用CentOS7。 我试图在github.com上设置本地git存储库和远程git存储库之间的连接。但我的本地存储库正在运行,它位于代理之后。 我在stackoverflow上找到了很多关于这个问题的答案。也许我不那么专注,等等......但我还没有解决我的问题。 我的步骤是:

  
      
  1. 在github.com上创建存储库
  2.   
  3. 使用本教程https://help.github.com/articles/generating-ssh-keys/生成SSH密钥   但是在使用命令ssh -T git@github.com之后的链接教程中的“第5步:测试连接”   我有点困惑。   连接不起作用,我收到此错误:   ssh: Could not resolve hostname github.com: Name or service not known   块引用
  4.   

起初我尝试在git配置文件中设置代理: git config --global http.proxy http://http://192.168.32.2:3128但结果与我无法连接到我的远程存储库相同。

  

下一步是将/ etc / hosts中github.com的地址设置为:192.30.252.0 github.com   我从这里https://help.github.com/articles/what-ip-addresses-does-github-use-that-i-should-whitelist/获取的github.com的地址。   使用命令ssh -T git@github.com后,所有内容都会挂断。

尽管通过ssh连接无法正常工作,但我尝试将存储库从我的远程github帐户克隆到我工作的本地帐户:git clone https://github.com/Nit84/hello-world.git。一切都按原样复制,没有任何密码。 此时我刚刚堆叠。而且我不知道该做些什么。

  

以下是使用git config --list的配置列表:

[root@localhost hello-world]# git config --list
user.name=Nit84
user.email=blob@gmail.com
core.editor=vim
http.proxy=http://192.168.32.2:3128
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=ssh://git@github.com/Nit84/hello-world.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

这是ssh -vT git@github.com的详细模式:

[root@localhost hello-world]# ssh -vT github.com
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
ssh: Could not resolve hostname github.com: Name or service not known

有没有办法通过代理上的ssh-keys解决我在git本地和远程存储库之间的连接问题?简单地说我想要我的命令ssh -T git@github.com就像在genereting ssh keys

中描述的那样工作

0 个答案:

没有答案
相关问题