How to run (git/ssh) authentication agent?

来源:互联网 发布:图纸软件哪个好 编辑:程序博客网 时间:2024/06/08 05:45

原文:http://stackoverflow.com/questions/4083079/how-to-run-git-ssh-authentication-agent


If you're using Msysgit, you can find a good tutorial here: http://anterence.blogspot.com/2012/01/ssh-agent-in-msysgit.html

  1. Add a file called .bashrc to your home folder
  2. Open the file and paste in:

    #! /bin/bash eval `ssh-agent -s` ssh-add
  3. This assumes that your key is in the conventional ~/.ssh/id_rsa location. If it isn't, include a full path after the ssh-add command.
  4. Add to or create file ~/.ssh/config with the contents

    ForwardAgent yes

    In the original tutorial the ForwardAgent param is Yes, but it's a typo. Use all lowercase or you'll get errors.

  5. Restart Msysgit. It will ask you to enter your passphrase once, and that's it (until you end the session, or your ssh-agent is killed.)

[EDIT] If you don't want to start a new ssh-agent every time you open a terminal, check out Keychain. I'm on a Mac now, so I used this tutorial to set it up, but I'm sure a Google search will have plenty of info for Windows.


原创粉丝点击