Articles in this section

Adding remote Bitbucket repository to Plesk fails: Permission denied (publickey)

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • Adding remote Bitbucket repository to Plesk in Domains > example.com > Git fails:

    PLESK_ERROR: Deploying files to example.com
    Public key for the server at 'bitbucket.org' is already known in '/var/www/vhosts/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.

Cause

The SSH key was generated with passphrase protection.

Resolution

Support of SSH keys with passphrase protection is yet to be implemented in the Plesk Git extension.

Vote for the corresponding feature suggestion on our UserVoice portal.
The top-ranked suggestions are likely to be implemented in one of the next versions of the extension.

Until this feature is implemented, the following workaround can be used:

  1. Generate an SSH key without passphrase protection in the Bitbucket account.

  2. Connect to the server via using SSH.

  3. Rename the files id_rsa and id_rsa.pub in /var/www/vhosts/example.com in case they are exist:

    # mv /var/www/vhosts/example.com/id_rsa{,.orig}
    # mv /var/www/vhosts/example.com/id_rsa.pub{,.orig}

  4. Place the files id_rsa and id_rsa.pub created on step 1 into /var/www/vhosts/example.com.

  5. Go to Domains > example.com > Git and add the Bitbucket repository.

Was this article helpful?

Comments

1 comment
Date Votes

Please sign in to leave a comment.