The authenticity of host 'github.com (192.30.252.130)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
**SSH 首次連線** 到新主機時,本機 `~/.ssh/known_hosts` 無該主機的公鑰指紋,**無法驗證主機身份**,Git 詢問是否信任並記錄。
yes 按 Enter。Warning: Permanently added 'github.com' (RSA) to the list of known hosts. 即成功。
# GitHub 官方 RSA 指紋 (SHA256)
SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
# 或 MD5
MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
**安全建議**:首次連線前,至 GitHub 官方文件 核對指紋,**確認無中間人攻擊**後再輸入 `yes`。
| 現象 | 解決 |
|---|---|
| Permission denied (publickey) | SSH 金鑰未加入 GitHub:`ssh-keygen -t ed25519` → 複製 `~/.ssh/id_ed25519.pub` 到 GitHub Settings → SSH Keys。 |
| Repository not found | 遠端 URL 錯誤:`git remote set-url origin git@github.com:username/repo.git`。 |
| known_hosts 損壞/指紋變更 | `ssh-keygen -R github.com` 移除舊記錄,重新連線信任新指紋。 |