我已成功使用SSH密钥在GIT BASH shell中工作,所以我知道我的基本配置步骤是正确的,但我更喜欢Windows PowerShell(实际上我更喜欢Mac或Linux终端,但在可用选项中…)
无论如何。
我的Windows PowerShell已经设置了PS1脚本,该脚本可以在此博客文章中找到http://markembling.info/2009/09/ssh-agent-in-powershell ,我可以看出,启动正在正确运行。
但是,当我尝试从 PowerShell 进行 SSH 或运行 git 命令时,仍会提示输入密码。有人遇到过这种情况吗?我更喜欢使用 PowerShell 而不是 Git Bash,但在最坏的情况下将继续使用它。
编辑 - VonC 提供的答案 = 将 %HOME% 添加到 Windows 系统环境变量中。
无论如何。
我的Windows PowerShell已经设置了PS1脚本,该脚本可以在此博客文章中找到http://markembling.info/2009/09/ssh-agent-in-powershell ,我可以看出,启动正在正确运行。
Starting SSH agent...
SSH agent PID: 5064
但是,当我尝试从 PowerShell 进行 SSH 或运行 git 命令时,仍会提示输入密码。有人遇到过这种情况吗?我更喜欢使用 PowerShell 而不是 Git Bash,但在最坏的情况下将继续使用它。
编辑 - VonC 提供的答案 = 将 %HOME% 添加到 Windows 系统环境变量中。
To view or change environment variables:
Right-click My Computer, and then click Properties.
Click the Advanced tab.
Click Environment variables.
Click one the following options, under user variables:
Click New
variable name `HOME` (No quotes, or percentage signs)
value: C:\Documents and Settings\**your username**
or: C:\Users\**your username**
重新启动powershell(或您喜欢的任何shell),默认情况下,您的SSH将正常工作。