Permission denied (publickey)

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

この記事はアトラシアンのクラウド製品にのみ適用されます。クラウドとサーバー製品の違いについてはこちらをご確認ください。

問題

When attempting to clone, push or pull over SSH with Git or Mercurial, you receive the message

Permission denied (publickey).

または

remote: Permission denied (publickey).
abort: no suitable response from remote hg! 

または

abort: Permission denied: (project name)

診断

You are receiving this message because Bitbucket Cloud could not authenticate you with any of the keys that were offered to it by your SSH agent. To verify this is the case, do the following 

ssh -T hg@bitbucket.org

This will attempt to create a connection to Bitbucket Cloud for Mercurial. You should receive a response similar to the following if your key is correctly loaded

$ ssh -T hg@bitbucket.org
conq: logged in as username.

If you do not see a message similar to the above, read on.

ソリューション

This can be caused by a couple of factors, but these are the most common:

- Your public key isn't loaded into Bitbucket Cloud

To check to see if your public key is loaded into Bitbucket Cloud, do the following:

  1. Open a browser and log into Bitbucket Cloud.
  2. Choose Your avatar > Bitbucket settings from the menu bar.

    The system displays the Account settings page.
  3. Click SSH keys in the Security section.
    The SSH Keys page displays. It shows a list of any existing keys.
  4. If you do not have any keys listed, follow Set up an SSH key to set one up.

- Your identity isn't loaded into your SSH Agent

If your SSH agent doesn't know to offer Bitbucket Cloud a key, the connection will fail. To find out what keys your SSH Agent currently is offering, and add them, do the following:

Windows

Double-click Pageant to view loaded keys (Pageant is a PuTTY authentication agent).

Click 'Add Key' to add any key not found in the list

On GitBash, OSX or Linux
$ ssh-add -l

Then, if you don't see your key listed, add it by 

ssh-add ~/.ssh/identity

For more information, check out our full Troubleshoot SSH issues guide.

- You do not have permission to create the repository on your local filesystem

If you get the error "Permission denied", it is also possible that git or mercurial doesn't have permission to create the project folder locally. Check permissions for the directory where you're attempting to check out the project, and make sure you have write access.

説明

When attempting to clone, push or pull over SSH with Git or Mercurial, you receive "permission denied" errors.

製品 Bitbucket
最終更新日: 2018 年 9 月 15 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.