I'm trying to reach the Gitlab server to clone a repo in a Ubuntu 20.10 computer, but I always get the message:
ssh: connect to host gitlab.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
So, I've tried to run the command ssh -T [email protected]
, but I've got the message:
ssh: connect to host gitlab.com port 22: Network is unreachable
I've tried in another computer with Ubuntu 20.04 and it worked.
Anyone can help me with this?
For GitLab there's an alternative to using port 22, check out this article: about.gitlab.com/blog/2016/02/18/… In general, some ISP block traffic on specific ports, same thing that happens in public networks like in hotels.
If the issue persists with other services ( ssh -Tv [email protected] ), then SSH URLs are not allowed for you. Use an HTTPS URL. But if on the same network, another server does work, then double-check the firewall rules for your particular machine. One might block SSH, while the other not. 1.) You are on a network which blocks traffic to port 22.
Host gitlab.com Hostname altssh.gitlab.com User git Port 443 PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa An error occurred while loading designs. Please try again.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link! 1.) You are on a network which blocks traffic to port 22. Trying your connection from another network or device would be the best way to quickly test for this.
I would never be able to use SSH URL for any public Git repository hosting service (github.com, gitlab.com, ...) in a work environment.
If the issue persists with other services (ssh -Tv [email protected]
), then SSH URLs are not allowed for you. Use an HTTPS URL.
But if on the same network, another server does work, then double-check the firewall rules for your particular machine. One might block SSH, while the other not.
(ufw status verbose
)
If you can't use ssh right now,You can use HTTPS instead with:
git remote set-url origin <Clone HTTPS address>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With