git 使用全局记住用户名密码后是明文,有没有加密的方式

git config --global credential.helper store

使用这个会在当前用户根目录下创建一个.git-credentials的文件用于明文保存用户名密码及相关链接

请问有没有加密后保存的方式

阅读 12.8k
2 个回答

OS X:
git config --global credential.helper osxkeychain
Windows:

There’s a tool named git-credential-winstore (available at http://gitcredentialstore.codeplex.com) to store these credentials in the Windows Credential Store.

Linux/Unix:

There’s a tool named git-credentialgnome-keyring (bundled with Git 1.8.0 and above) to store these credentials in the GNOME Keyring.

目测密文拿走了还是不安全。因为对称加密里面没有随机数。如果真想安全可以考虑使用使用ssh的方式进行认证,然后用RSA非对称加密。然后在非对称密码上再设置一个密码。Tip:绕过明文加密直接使用密文认证已经是很老的方法了。2333

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进