amazon-web-services - 通过 SSH 端口的 AWS Load Balancer Git 克隆错误

标签 amazon-web-services gitlab amazon-elb

总结

我们创建了一个 EC2 实例并安装了 Gitlab,之后我们创建了一个 Application Load Balancer,我们通过 HTTPS 配置了一个子域,一切正常,我们创建了一个新的存储库,添加我们的 ssh-keys,如果我们克隆HTTPS 一切正常,但通过 SSH 我们无法克隆它以解决此错误:

`ssh: connect to host gitlab.our.subdomain port 22: Connection refused`

重现步骤

  1. 创建了一个新的 EC2 并安装了 Gitlab
  2. 配置 Gitlab:
    • 外部网址 ' https://gitlab.our.subdomain/ '
    • nginx['redirect_http_to_https'] = true
    • nginx['redirect_http_to_https_port'] = 80
    • nginx['listen_port'] = 80
    • nginx['listen_https'] = false
    • "X-Forwarded-Proto"=> "https",
    • "X-Forwarded-Ssl"=> "打开" 3.- 设置 EC2 和 ALB 权限 Captura_de_pantalla_2018-10-16_a_la_s__12.17.27

Captura_de_pantalla_2018-10-16_a_la_s__12.17.19

当前的错误行为是什么?

```
git clone git@gitlab.our.subdomain:ucrea/ucrea_portal.git
Cloning into 'ucrea_portal'...
ssh: connect to host gitlab.realhost.cloud port 22: Connection refused
```

预期的正确行为是什么?

通过 SSH 克隆项目

相关日志

```
git clone git@gitlab.realhost.cloud:ucrea/ucrea_portal.git
Cloning into 'ucrea_portal'...
ssh: connect to host gitlab.our.dubdomain port 22: Connection refused
fatal: Could not read from remote repository.

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

包版本详情

发行商 ID:Ubuntu 说明:Ubuntu 18.04.1 LTS 发布:18.04 代号:仿生

```
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                         Version                             Architecture                        Description
+++-============================================================-===================================-===================================-==============================================================================================================================
ii  gitlab-ce                                                    11.3.4-ce.0                         amd64                               GitLab Community Edition (including NGINX, Postgres, Redis)
un  gitlab-ee                                                    <none>                              <none>                              (no description available)
```

环境细节

  • 操作系统:Ubuntu 18.04.1 LTS
  • 安装目标,删除不正确的值:
    • EC2
    • 虚拟机:AWS
    • 其他:应用程序负载均衡器
  • 安装类型,删除不正确的值:
    • 新安装
    • 从版本 11.3.4-ce.0 升级
    • 其他:11.3.4-ce.0

配置详情

  • 外部网址 ' https://gitlab.our.subdomain/ '
  • nginx['redirect_http_to_https'] = true
  • nginx['redirect_http_to_https_port'] = 80
  • nginx['listen_port'] = 80
  • nginx['listen_https'] = false
  • "X-Forwarded-Proto"=> "https",
  • "X-Forwarded-Ssl"=> "打开"

最佳答案

@Ulises 使用经典的弹性负载均衡器,允许入口端口 80、22 和安全组。

关于amazon-web-services - 通过 SSH 端口的 AWS Load Balancer Git 克隆错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52841432/

相关文章:

Gitlab - 查看提交中删除的文件列表

amazon-web-services - 向 Application Load Balancer (ALB) 注册 EC2 实例的问题

java - 如何让 Spring Security 在跨多个域的负载均衡器后面工作?

gitlab - 为什么美人鱼图没有出现在 GitLab 中?

linux - 如何为2个不同的gitlab帐户设置ssh配置?

java - 增加 Undertow 服务器中的线程

amazon-web-services - 如何设置 Ingress 以连接到 ClusterIP 服务?

amazon-web-services - 分配 IAM 用户仅访问一个 EC2 实例

mysql - AWS RDS 多可用区 "Storage Full"故障转移

java - Spring Integration + Amazon SQS 队列的工作示例