skip to Main Content

I am using this method mentioned here to clone my Github repo to my httpdocs folder: Is it possible to connect to private Github repositories using Plesk Git extension?, but I am unable to connect. I always get the following error:

Public key for the server at ‘github.com’ is already known in ‘/var/www/vhosts/new.example.com/.ssh/git_known_hosts’.

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

I am not using the standard SSH port but even if I switch to the default 22, I keep getting similar errors.

My firewall is accepting connections on my SSH port and I have added the public key on the SSH section on my Github account.

HTTPS is not an option because I am cloning a shared private repo.

I am using Centos 7 with Plesk Obsidian. Everything up to date.

I tried to use the same procedure on my Plesk Onyx server and it worked fine. Same firewall settings.

Any suggestions?

Thanks.

4

Answers


  1. Chosen as BEST ANSWER

    I managed to resolve it with the help of a support agent from Plesk (through teamviewer). I had to delete or rename the id_rsa, id_rsa.pub and known_hosts files from the .ssh folder and recopy the ssh key to my github account.


  2. That error message generally appears when you already used the Plesk Git extension in some domain, so the solution is to have a different SSH public key for each domain you want to associate with a Git repo.
    If you are in the Plesk panel, you should create a new subscription for that specific domain in order to get a new SSH public key generated by default in the Plesk Git extension.
    Remember to add the public SSH key generated in you Github account.

    Login or Signup to reply.
  3. You may try the following (solution for UBUNTU).

    1. Get details from key inside plesk: /etc/ssh# nano ssh_host_ed25519_key.pub
    2. Copy the content as is, eg; "ssh-ed25519 AAAAC… plesk.page"
    3. Go to Github –> SSH Keys page and create a new key, Name your key and paste the content from ssh_host_ed25519_key.pub
    4. After completion step 3, Go to plesk and create GitHub repository, ignore copying/pasting the SSH public key from plesk. It should now work.
    5. Alternative see this extension from Plesk to manage SSH Keys.
      https://www.plesk.com/extensions/ssh-keys/
    Login or Signup to reply.
  4. After changing domain name GIT cloning was no more working.

    In my case the following file had to be updated:

    nano /etc/ssh/ssh_host_rsa_key.pub
    

    the domain name was at the end of the long line:

    ssh-rsa <SSH public key> <domain to be replaced>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search