skip to Main Content

My attempt:

ssh-keygen -f /var/www/vhosts/DOMAIN/.ssh/git_known_hosts -R bitbucket.org
curl https://bitbucket.org/site/ssh >> /var/www/vhosts/buchungsformular.spar-mit.com/.ssh/git_known_hosts

But I still cannot clone my repository.

Some detailed error messages from plesk:

1.

Public key for the server at ‘bitbucket.org’ is already known in ‘/var/www/vhosts/DOMAIN/.ssh/git_known_hosts’. Warning: the ECDSA host key for ‘bitbucket.org’ differs from the key for the IP address ‘xxx’ Offending key for IP in /var/www/vhosts/DOMAIN/.ssh/git_known_hosts:1 Matching host key in /var/www/vhosts/DOMAIN/.ssh/git_known_hosts:8 Exiting, you have requested strict checking. Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

2.

do_known_hosts: hostkeys_foreach failed: Permission denied Server at ‘bitbucket.org’ is seen for the first time. Adding its public key to the list of known hosts in ‘/var/www/vhosts/DOMAIN/.ssh/git_known_hosts’. # bitbucket.org:22 SSH-2.0-conker_f1… 04…. # bitbucket.org:22 SSH-2.0-conker_… 5… # bitbucket.org:22 SSH-2.0-conker_f…. d… /usr/local/psa/admin/sbin/modules/git/git_ssh: line 49: /var/www/vhosts/DOMAIN/.ssh/git_known_hosts: Permission denied Failed to add public SSH host key for the ‘bitbucket.org’ into ‘/var/www/vhosts/DOMAIN/.ssh/git_known_hosts’. No ECDSA host key is known for bitbucket.org and you have requested strict checking. Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

3.

Public key for the server at ‘bitbucket.org’ is already known in ‘/var/www/vhosts/DOMAIN/.ssh/git_known_hosts’. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is SHA256:4…… Please contact your system administrator. Add correct host key in /var/www/vhosts/DOMAIN/.ssh/git_known_hosts to get rid of this message. Offending RSA key in /var/www/vhosts/DOMAIN/.ssh/git_known_hosts:1 remove with: ssh-keygen -f "/var/www/vhosts/DOMAIN/.ssh/git_known_hosts" -R bitbucket.org RSA host key for bitbucket.org has changed and you have requested strict checking. Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Expected the repo to work again.

2

Answers


  1. Chosen as BEST ANSWER

    I needed to specify IdentifyFile .ssh/id_rsa and UserKnownHostsFile .ssh/git_known_host in the ~/.ssh/config file.


  2. The SSH Key by design is generated by the Plesk git extension on a subscription level, instead of a domain, therefor adding the same keys to a different repository in GitHub will result in this error. Resolution:

    1- Log in to GitHub
    2- Remove the SSH key from the repository that is using this SSH key
    3- Add the SSH key to your GitHub account: add it to your account

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