# SSH 故障排除

使用 SSH 进行连接和身份验证 GitHub时，可能需要解决可能出现的意外问题。

## Links

* [使用 SSH 通过 HTTPS 端口连接](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/using-ssh-over-the-https-port)

  有时，防火墙会完全拒绝允许 SSH 连接。 如果无法选择使用具有凭据缓存的 HTTPS 克隆，可以尝试使用通过 HTTPS 端口建立的 SSH 连接克隆。 大多数防火墙规则应允许此操作，但代理服务器可能会干扰。

* [恢复 SSH 密钥密码](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/recovering-your-ssh-key-passphrase)

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

* [已删除或缺少的 SSH 密钥](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/deleted-or-missing-ssh-keys)

  作为安全预防措施， GitHub 自动删除一年内未使用的 SSH 密钥。

* [错误：主机密钥验证失败](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-host-key-verification-failed)

  作为安全预防措施，SSH 会跟踪之前看到的主机。

* [错误：权限被拒绝（公钥）](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-permission-denied-publickey)

  “权限被拒绝”错误表示服务器拒绝了您的连接。 可能有多个原因，最常见的如下所述。

* [错误：文件编号错误](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-bad-file-number)

  此错误通常表示您无法连接到服务器。 这通常由防火墙和代理服务器造成。

* [错误：密钥已被使用](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-key-already-in-use)

  尝试添加已添加到其他帐户或存储库的密钥时，会发生此错误。

* [错误：用户/仓库拒绝其他用户的权限](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-permission-to-userrepo-denied-to-other-user)

  此错误意味着您使用的密钥绑定到一个没有仓库访问权限的账户。

* [错误：用户/仓库拒绝用户/其他仓库的权限](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-permission-to-userrepo-denied-to-userother-repo)

  此错误意味着您正在推送的密钥作为 deploy key 附加到另一个仓库，并且对您尝试推送到的仓库的没有访问权限。

* [错误：代理承认没有签署](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-agent-admitted-failure-to-sign)

  在极少数情况下，通过 SSH 在 Linux 上连接到 GitHub 会产生错误 "Agent admitted failure to sign using the key"。 请遵循以下步骤解决此问题。

* [错误：ssh-add：非法选项 -- apple-use-keychain](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-ssh-add-illegal-option----apple-use-keychain)

  此错误意味着你的 ssh-add 版本不支持 macOS 密钥链集成，此集成允许你将密码存储在密钥链中。

* [错误：SSL 证书有问题，请验证 CA 证书是否正常](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-ssl-certificate-problem-verify-that-the-ca-cert-is-ok)

  此错误意味着您的 CA 根证书已过期。 如果需要更新 CA 根证书，则无法从 GitHub 存储库推送或拉取。

* [错误：未知密钥类型](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-unknown-key-type)

  此错误表示您使用的 SSH 密钥类型无法识别或不受 SSH 客户端支持。

* [错误：我们正在进行 SSH 密钥审核](/zh/enterprise-cloud@latest/authentication/troubleshooting-ssh/error-were-doing-an-ssh-key-audit)

  此错误意味着无法验证正在用于执行 Git 操作的 SSH 密钥。