I am trying to clone repository from remote git.
I have shared hosting and I have created new repository in my cPanel.
I have created new pair of ssh keys using ssh-keygen
Then imported key in cpanel from "SSH Access".
To connect from local machine, I have added following commands on git bash
$ eval ssh-agent
Agent pid 1286
$ ssh-add id_rsa_prasad_local
Identity added: id_rsa_prasad_local (PG@DESKTOP-HAFRU7M)
$ git clone ssh://[email protected]/home/hostcd1m/test
then it is showing error as below
Cloning into ‘test’…
ssh: connect to host mywebsitename.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.
Am I missing anything ?
3
Answers
Domain name was not pointed to server's host name. so if I try to clone with server hostname , I able to clone it successfully.
example :
git clone ssh://[email protected]/home/hostcd1m/test
so I pointed my domain name 'mywebsite.com' to server hostname 'ServerHostName.Net'.
I usually have that (in an enterprise environment) when SSH is not allowed, meaning the network route does allow
Depending on your own environment, check with an admin if SSH connections are allowed.
Had this issue recently, but non of the other suggestions seemed to resolve for me. In my case, the issue was with the algorithm used to generate my SSH keys – rsa. This had been working, but stopped (deprecation, I believe).
Checked with:
Output included the fact that there was no mutual signature algorithm:
SSH keys were then regenerated (in the default location) using ECDSA algorithm:
And finally, the public key re-added on the site. After this, I stopped getting the above error.