gpt4 book ai didi

ssh - GitLab ssh over cloudflare 和代理

转载 作者:行者123 更新时间:2023-12-02 14:27:28 26 4
gpt4 key购买 nike

我已经在 proxmox 中的 lxc 容器上安装了 gitlab。

它的工作方式类似于 gitlab <-> proxy <-> cloudflare .

除了 SSH 克隆/推送/拉取之外,一切正常,但是,如果我要在 /ets/hosts 中添加一个条目的话(在本地机器或我使用 gitlab 的任何其他服务器上)将我的公共(public) IP 设置为 proxy和我的 gitlab 的域名 - 没关系。
proxy VM 也是 lxc 容器。我只是将 22 端口重定向到 gitlab有规则的虚拟机

-A PREROUTING -d AAA.AAA.AAA.AAA/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination 192.168.10.150:22
ssh -T git@git.MYHOST

这适用于 hosts 中的条目文件。但如果删除 - 它不起作用。

错误:
# git pull

ssh: connect to host git.peacedata.su port 22: Network is unreachable
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

2020 年 4 月 24 日更新

我发现,Cloudflare 阻止了 22port。
我有一些解决方法,但我需要最“漂亮”的解决方案))。

最佳答案

所以,我只是将直接 IP 地址添加到 /etc/hosts所有的作品都是一种魅力。

更多关于 cloudflare 开放端口的解释以及为什么如此链接:https://blog.cloudflare.com/cloudflare-now-supporting-more-ports/

关于ssh - GitLab ssh over cloudflare 和代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61391889/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com