[英]Windows command line GIT password prompt
I have mysysgit and TortoiseGit installed on a Windows PC, which connects to a remote Git repo on a Linux box. 我在Windows PC上安装了mysysgit和TortoiseGit,该PC连接到Linux机器上的远程Git存储库。 I have created ssh keys, and added them to the profile in TortoiseGit.
我已经创建了ssh密钥,并将它们添加到TortoiseGit中的配置文件中。 When I interact with the remote repo in TortoiseGit, it all works fine.
当我在TortoiseGit中与远程仓库交互时,一切正常。 No password prompting.
没有密码提示。 However, when I try to run Git commands from the command line, I get prompted for the SSH password.
但是,当我尝试从命令行运行Git命令时,系统提示输入SSH密码。
What do I need to do so that I'm not prompted for the password from the command line? 我需要怎么做才能不提示我从命令行输入密码?
Make sure your git session references the TortoisePLink.exe
(in GIT_SSH environment variable), as described in " Why git can't remember my passphrase under Windows ": 确保您的git会话引用了
TortoisePLink.exe
(在GIT_SSH环境变量中),如“ 为什么git在Windows下无法记住我的密码短语 ”中所述:
(you might have done the first two steps already) (您可能已经完成了前两个步骤)
pageant.exe
using TortoiseGit's puttygen.exe
. puttygen.exe
转换您的密钥以用于TortoiseGit的pageant.exe
。 pageant.exe
, open your .ppk
file ("Add Key"), and provide your passphrase for your key. pageant.exe
,打开您的.ppk
文件(“添加密钥”),并提供密钥密码。 add the environment variable: 添加环境变量:
GIT_SSH=C:\\full\\path\\to\\TortoisePlink.exe
This assumes your TortoiseGit is using TortoisePlink.exe
. 假设您的TortoiseGit使用的是
TortoisePlink.exe
。
The OP scott80109 concludes in the comments : OP scott80109 在评论中总结:
msysgit was installed to use Open SSH.
已安装msysgit以使用Open SSH。
I changed it to useplink
, and it now works without a prompt我将其更改为使用
plink
,现在无需提示即可使用
Erez A. Korn adds in the comments : Erez A. Korn 在评论中添加:
I prefer to use openssh as it doesn't require me to have my key in an alternative format (ppk).
我更喜欢使用openssh,因为它不需要我将密钥设置为其他格式(ppk)。
I've written a small wrapper to launch thessh-agent
and take care of business and then added it to my Windows Startup.我编写了一个小的包装程序来启动
ssh-agent
并处理事务,然后将其添加到Windows Startup中。
You can check the code inerezak/ssh-agent-wrapper-win
.您可以在
erezak/ssh-agent-wrapper-win
检查代码。
I recommend to use pageant. 我建议使用选美比赛。 read this http://guides.beanstalkapp.com/version-control/git-on-windows.html and add you ssh-key to pageant.
阅读此http://guides.beanstalkapp.com/version-control/git-on-windows.html并将ssh-key添加到选美中。 it affects globally.
它影响全球。
My use case needed multiple github users with passphrase-protected ssh keys. 我的用例需要使用密码保护的ssh密钥的多个github用户。
I sorted my ~.ssh/config
file to use different keys for different repo domains, as described here 我整理我的
~.ssh/config
文件,以用于不同的回购域不同的密钥,如所描述这里
However, I don't want to type my passphrase every time, and I don't want to use ssh-agent. 但是,我不想每次都输入密码,也不想使用ssh-agent。
Here's how I set up Pageant to ask for and remember my passphrase on Windows login: 这是我设置Pageant来询问并记住Windows登录密码的方法:
C:\\putty\\PAGEANT.EXE plato_cambrian.ppk plato.ppk
" C:\\putty\\PAGEANT.EXE plato_cambrian.ppk plato.ppk
” Also, for anyone on ubuntu/linux mint who ended up here, I documented similar steps here 另外,在Ubuntu / Linux Mint的谁结束了在这里的人,我记录的类似的步骤在这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.