Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Load Balancer Git Clone error over SSH Port

Summary

We created a EC2 Instance and install Gitlab, after that we created an Application Load Balancer, we configure it with a subdomain over HTTPS, all works fine, we created a new repositorie, add our ssh-keys, if we clone the HTTPS its all ok, but over SSH we can't clone it for this error:

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

Steps to reproduce

  1. Created a new EC2 and install Gitlab
  2. Configure Gitlab:
    • external_url '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" => "on" 3.- Set permissions over EC2 and 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

What is the current bug behavior?

```
git clone [email protected]:ucrea/ucrea_portal.git
Cloning into 'ucrea_portal'...
ssh: connect to host gitlab.realhost.cloud port 22: Connection refused
```

What is the expected correct behavior?

Clone de project over SSH

Relevant logs

```
git clone [email protected]: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.
```

Details of package version

Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic

```
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)
```

Environment details

  • Operating System: Ubuntu 18.04.1 LTS
  • Installation Target, remove incorrect values:
    • EC2
    • VM: AWS
    • Other: Application Load Balancer
  • Installation Type, remove incorrect values:
    • New Installation
    • Upgrade from version 11.3.4-ce.0
    • Other: 11.3.4-ce.0

Configuration details

  • external_url '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" => "on"
like image 415
Ulises Avatar asked May 01 '26 07:05

Ulises


1 Answers

@Ulises Use a classic elastic load balancer allowing ingress ports 80, 22 with security groups.

like image 180
PruthviRaj Reddy Avatar answered May 02 '26 21:05

PruthviRaj Reddy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!