【发布时间】:2021-02-18 16:42:00
【问题描述】:
将 git HTTPS 凭据缓存与 git config --global credential.helper 'cache 相比如何与使用 git SSH 密钥身份验证安全性进行比较?
git credential.helper cache 的 documentation 表示:
The stored credentials never touch the disk, and are forgotten after a configurable timeout. The
cache is accessible over a Unix domain socket, restricted to the current user by filesystem permissions.
我发现您可以通过以下方式查看 HTTPS 缓存凭据
echo url=https://[example.com] | git credential fill。不确定这与使用 SSH 密钥的安全含义。如果其他人 SSH 进入同一设备(作为具有不同 SSH 密钥的不同用户),他们是否也能够查看凭据,或者因为他们是不同的用户,他们将无法以这种方式查看凭据?
鉴于使用这两种方法,如果有人可以访问您的系统并假设您的用户,他们可以查看密码或 SSH 密钥,是否正确地说 HTTPS 身份验证通常更安全,因为它在给定期限 II) 重启后到期,III) 可以配置为仅针对某些 git 操作的范围权限?
【问题讨论】: