阅读532 返回首页    go 阿里云 go 技术社区[云栖]


How to run (git/ssh) authentication agent?

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


If you're using Msysgit, you can find a good tutorial here: https://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.


最后更新:2017-04-04 07:03:44

  上一篇:go Android TextView的字符过滤功能
  下一篇:go 自定义程序实现Android EditText只允许输入指定字符