Skip to main content

此版本的 GitHub Enterprise 已停止服务 2022-10-12. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

使用 SSH 密钥密码

您可以保护 SSH 密钥并配置身份验证代理,这� �您就不必在每次使用 SSH 密钥时重新输入密� �。

关于 SSH 密钥的通行短语

使用 SSH 密钥时,如果攻击者获得� 计算机的访问权限,便可以访问使用该密钥的每个系统。 要添� 额外的安全层,可以向 SSH 密钥添� 密� �。 为避免每次连接时都输入通行短语,可以将通行短语安全地保存在 SSH 代理中。

添� 或更改密� �

通过输入以下命令,您可以更改现有私钥的密� �而� 需重新生成密钥对:

$ ssh-keygen -p -f ~/.ssh/id_ed25519
> Enter old passphrase: [Type old passphrase]
> Key has comment 'your_email@example.com'
> Enter new passphrase (empty for no passphrase): [Type new passphrase]
> Enter same passphrase again: [Repeat the new passphrase]
> Your identification has been saved with the new passphrase.

如果您的密钥已有密� �,系统将提示您输入该密� �,然后才能更改为新密� �。