簡體   English   中英

無法將遠程 git repo 從 cPanel 克隆到本地 PC

[英]Can't clone remote git repo from cPanel to local PC

我已經通過 cPanel 在我的共享主機帳戶中創建了 GIT 存儲庫。 然后我用 Windows 將 Git 安裝到我的本地 PC,右鍵單擊本地 repo 文件夾並選擇命令“Git Bash Here”。 接下來我在 CMD 中運行了類似的命令

git clone ssh://user123@example.com/home/user123/public_html/repo

我第一次收到

The authenticity of host 'example.com (...)' can't be established.
ED25519 key fingerprint is SHA256:...
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?

我輸入了“是”並收到錯誤

Warning: Permanently added 'example.com' (ED25519) to the list of known hosts.
user123@example.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

接下來,我將文件 id_rsa 從我主機的.ssh文件夾復制粘貼到我的本地文件夾C:/Users/MyUserName/.ssh現在,如果我運行克隆命令,我會收到

Enter passphrase for key '/c/Users/MyUserName/.ssh/id_rsa':

為什么? 密碼是什么,我在哪里可以得到它?

密碼短語是您在創建 ssh 密鑰時使用的密碼。 您必須使用這些密碼來解鎖對 ssh 密鑰的訪問。

請注意,警告(關於主機是否已知)只是:警告。 一次連接到某個其他系統時,您的 ssh 軟件會檢查來自該主機的身份消息。 但沒有什么檢查,所以你得到的警告。 之后,身份被保存,所以第二次第三次等,當你連接到主機時,你的 ssh 確保它以相同的方式標識自己。 (這是具有主機告訴它的密碼,然后您再檢查,以確保你還在談論同一個人的幻想式的變體。)

當然,主機不知道的人自稱是你是否真的是你,所以主機要求提供您的密碼。 在這種情況下,您的“密碼”是您的 ssh 密鑰……並且您的 ssh 密鑰受另一個密碼保護(或者更確切地說,“密碼短語”:您可以使用多個單詞)。 所以你給你的機器你的“get me the password”密碼短語,之后你的機器得到密碼以提供給他們的主機。

暫無
暫無

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

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