Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过SSH隧道使用Gitlab_Git_Ssh_Gitlab - Fatal编程技术网

通过SSH隧道使用Gitlab

通过SSH隧道使用Gitlab,git,ssh,gitlab,Git,Ssh,Gitlab,情况: 我在machine1工作,在那里我有根访问权限。从machine1,我可以通过ssh访问machine2(我是一个没有特权的用户)。 machine3(也是没有权限的用户)不能直接从machine1访问。我需要使用machine2的ssh连接来访问machine3。 简而言之:machine1可以ssh到machine2,但不能到machine3。machine2可以ssh连接到machine3 我想在machine3上使用gitlab,但我不能。如果我尝试克隆我的存储库,我有: Ini

情况:

我在machine1工作,在那里我有根访问权限。从machine1,我可以通过ssh访问machine2(我是一个没有特权的用户)。 machine3(也是没有权限的用户)不能直接从machine1访问。我需要使用machine2的ssh连接来访问machine3。 简而言之:machine1可以ssh到machine2,但不能到machine3。machine2可以ssh连接到machine3

我想在machine3上使用gitlab,但我不能。如果我尝试克隆我的存储库,我有:

Initialized empty Git repository in /path/nameOfRepository/.git/
ssh: gitlab.lmps.ru: Temporary failure in name resolution
fatal: The remote end hung up unexpectedly
ping: unknown host google.com
事实上,如果我尝试在machine3上ping google.com,我会:

Initialized empty Git repository in /path/nameOfRepository/.git/
ssh: gitlab.lmps.ru: Temporary failure in name resolution
fatal: The remote end hung up unexpectedly
ping: unknown host google.com
因此,machine3上可能没有internet连接。但是我在machine2上有internet连接,但是machine2上没有git

我想通过具有internet连接的machine2在machine3上使用git(克隆并推送到gitlab)

关于同一个问题有很多手册,但我是SSH和linux的初学者,不能处理它

最后:我在gitlab上有一个存储库,希望在machine3到machine2上使用它


顺便说一句,对不起我的英语。

在机器2上安装代理,例如apache squid,在开放端口(默认为3128)上运行,在conf文件上进行一些配置,例如将机器3 ip作为接受源

转到机器3并设置机器2的代理地址及其端口。例如,设置http_proxy和https_proxy env变量

如果没有其他限制,这是一个解决问题的示例概念。如果你有问题,就用谷歌搜索一下这个概念