# 关于 SSH

使用 SSH 协议可以连接远程服务器和服务并向它们验证。 使用 SSH 密钥后，您无需在每次访问时都提供用户名和 GitHub，即可连接到 personal access token。 还可以使用 SSH 密钥对提交进行签名。

可以使用 SSH（安全外壳协议）在 GitHub 上的存储库中访问和写入数据。 通过 SSH 进行连接时，使用本地计算机上的私钥文件进行身份验证。 有关 SSH 的详细信息，请参阅 Wikipedia 上的 [Secure Shell](https://en.wikipedia.org/wiki/Secure_Shell) 。

设置 SSH 时，需要生成新的 SSH 私钥并将其添加到 SSH 代理中。 在使用该密钥进行身份验证或为提交签名之前，您还必须将 SSH 公钥添加到您在 GitHub 上的帐户中。 有关详细信息，请参阅“[生成新的 SSH 密钥并将其添加到 ssh-agent](/zh/enterprise-server@3.22/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)”、“[将新的 SSH 密钥添加到GitHub帐户](/zh/enterprise-server@3.22/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)”和“[关于提交签名验证](/zh/enterprise-server@3.22/authentication/managing-commit-signature-verification/about-commit-signature-verification)”。

您可以使用硬件安全密钥来进一步保护 SSH 密钥，当密钥对用于通过 SSH 进行身份验证时，需要将物理硬件安全密钥附加到计算机上。 您还可以通过将密钥添加到 ssh 代理并使用密码来保护您的 SSH 密钥。 有关详细信息，请参阅“[使用 SSH 密钥密码](/zh/enterprise-server@3.22/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases)”。

为了保持帐户安全，您可以定期检查您的 SSH 密钥列表，并撤销任何无效或已泄漏的密钥。 有关详细信息，请参阅“[检查 SSH 密钥](/zh/enterprise-server@3.22/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys)”。

使用 GitHub Enterprise Cloud 的组织可以提供 SSH 证书，成员可以使用该证书访问该组织的存储库，而无需将证书添加到其帐户中 GitHub。

## 其他阅读材料

* [SSH 故障排除](/zh/enterprise-server@3.22/authentication/troubleshooting-ssh)