簡體   English   中英

使用 SSH 克隆 BitBucket 存儲庫時出現問題

[英]Problem cloning a BitBucket repo using SSH

你好,stackoverflow 社區,

注意:當我使用 HTTPS 時,它可以工作。

所以我的問題如下:

每當我想使用 SSH 從 bitbucket 克隆一個 repo 時,它都會顯示一個錯誤:

Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

讓我解釋一下我是如何做到的:

ssh-keygen -t rsa -C "mymail@domain.com"

我有一個文件夾.ssh ,其中包含私鑰和公鑰。

接下來,我將公鑰復制到我的帳戶設置 > SSH 密鑰中。

之后:我執行了以下命令:

exec ssh-agent bash
ssh-add ~/path/to/id_rsa

現在,當我執行git clone "ssh/repo"我遇到了之前提到的問題。

請問這個怎么解決?

您必須將您的 ssh 密鑰告訴 Bitbucket。 我認為您已經完成了除Step 3. Add the public key to your Account settings所有操作Step 3. Add the public key to your Account settings從下面的參考鏈接Step 3. Add the public key to your Account settings ,但您可能希望逐步完成以防萬一。

https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM