After installing git on my new work computer, generating my ssh key and adding it on gitlab, I'm trying to clone a project but I get the following error:
ssh: connect to host <private-domain>.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.
I've also tried the command to just test the ssh connection with the verbose option and I get this:
$ ssh -Tvvv appgit@<private_domain>.com
OpenSSH_8.8p1, OpenSSL 1.1.1m 14 Dec 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/h/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/h/.ssh/known_hosts2'
debug2: resolving "<private_domain>.com" port 22
debug3: resolve_host: lookup <private_domain>.com:22
debug3: ssh_connect_direct: entering
debug1: Connecting to <private_domain>.com [<serv.ip.add.ress>] port 22.
debug3: set_sock_tos: set socket 4 IP_TOS 0x48
debug1: connect to address <serv.ip.add.ress> port 22: Connection timed out
ssh: connect to host <private_domain>.com port 22: Connection timed out
I know the domain exists, ping <private-domain>.com
works. I don't think it's a proxy issue because I'm not connecting with http or https.
None of the fixes in this answer changed anything. (I'm on Windows)
I've noticed that if I delete my keys in my ~/.ssh
folder, I get the same error, which makes me think this is a key problem and not a network problem. How can I be sure git is using the right key?
I've tried ssh-keygen -lf ~/.ssh/id_rsa -E md5
to see if the fingerprint matches the one on gitlab (it does) but that only gives me the one in the folder, not necessarily the one git uses. Git-gui Help>Show SSH Key
does show my key correctly though.