# 恢复 SSH 密钥密码

如果您丢失 SSH 密钥密码，则根据您使用的操作系统，您可能可以恢复它，也可能需要生成新的 SSH 密钥密码。

<div class="ghd-tool mac">

如果[使用 macOS 密钥链配置 SSH 密码](/zh/enterprise-cloud@latest/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases#saving-your-passphrase-in-the-keychain)，则能够恢复它。

1. 在 Finder 中，搜索 Keychain Access 应用。
2. 在 Keychain Access 中，搜索 SSH。
3. 双击 SSH 密钥的条目以打开一个新对话框。
4. 在左下角选择“显示密码”。
5. 系统将提示您输入管理密码。 在 "Keychain Access" 对话框中输入该密码。
6. 此时将显示您的密码。

</div>

<div class="ghd-tool windows">

如果您丢失 SSH 密钥密码，则无法进行恢复。 需要[生成全新的 SSH 密钥对](/zh/enterprise-cloud@latest/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)或[切换到 HTTPS 克隆](/zh/enterprise-cloud@latest/get-started/git-basics/about-remote-repositories#cloning-with-https-urls)，以便能够改用 personal access token。

</div>

<div class="ghd-tool linux">

如果您丢失 SSH 密钥密码，则无法进行恢复。 需要[生成全新的 SSH 密钥对](/zh/enterprise-cloud@latest/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)或[切换到 HTTPS 克隆](/zh/enterprise-cloud@latest/get-started/git-basics/about-remote-repositories#cloning-with-https-urls)，以便能够改用 personal access token。

</div>