skip to Main Content

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


  1. Chosen as BEST ANSWER

    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'.


  2. I usually have that (in an enterprise environment) when SSH is not allowed, meaning the network route does allow

    • port 22 to be visible for inbound connections (when the server is in the same LAN).
    • port 22 to be used for outbound connection (when the server is in a WAN, outside the local network)

    Depending on your own environment, check with an admin if SSH connections are allowed.

    Login or Signup to reply.
  3. 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:

    ssh -vvv <server> -p <portnumber>
    

    Output included the fact that there was no mutual signature algorithm:

    debug1: send_pubkey_test: no mutual signature algorithm
    

    SSH keys were then regenerated (in the default location) using ECDSA algorithm:

    ssh-keygen -t ecdsa -b 521
    

    And finally, the public key re-added on the site. After this, I stopped getting the above error.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search