How to run (git/ssh) authentication agent?

简介:

原文: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.


相关文章
|
网络安全 开发工具 git
git 使用 SSH 链接仓库
git 使用 SSH 链接仓库
323 0
|
网络安全 开发工具 git
配置本地环境以管理Git多账户SSH连接的方法
通过以上步駟设置后, 您可以轻松管理多個 Git 账户并且根据不同项目需求切换 SSH 密匙进行版本控制操作。
1701 20
|
安全 Linux 网络安全
Linux系统初步设置本地Git环境和生成SSH密钥的步骤。
现在您的Linux系统已经配置好了Git环境,并创建并添加了SSH密钥,可以安全地与远端仓库进行交互,无论是克隆、推送还是拉取操作。此过程确保了数据传输的安全并使版本控制流程更为顺畅。使用Git时应考虑定期更新并管理您的凭据,以确保安全性。
1868 0
|
Shell 网络安全 开发工具
Git常见问题解决:解决TortoiseGit的No supported authentication methods available错误。
总的来说,遇到"No supported authentication methods available"这个问题,就像是钓到了一条刺猬。解决它就像是给刺猬穿上一件新衣服。首先,你需要生成新的SSH秘钥对,然后,将你的公钥添加到Git服务器,这样,你的SSH客户端就能认出刺猬了。接下来,将你的私钥添加到SSH agent,让你的SSH客户端拥有这个刺猬的“身份证”。最后,你还需要告诉TortoiseGit,如何使用这个新的SSH秘钥,也就是将刺猬的“身份证”告诉TortoiseGit。只需要做到这四点,你就可以顺利地解决这个问题了。希望这个步骤为步的解决方法能够帮到你解决这个问题,让你的代码
1936 21
|
安全 Linux 网络安全
在Linux(CentOS和AWS)上安装更新的git2的方法并配置github-ssh
经过以上这些步骤,你现在就能在GitHub上顺利往返,如同海洋中的航海者自由驰骋。欢迎你加入码农的世界,享受这编程的乐趣吧!
762 10
|
Devops Shell 网络安全
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
1069 16
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
|
安全 Shell 网络安全
【Git】TortoiseGit(小乌龟)配置SSH和使用
【Git】TortoiseGit(小乌龟)配置SSH和使用
2418 0
|
网络安全 开发工具 git
使用git克隆仓库报错:Warning: Permanently added‘github.com’ to the .....(ssh )
所以,你可以安全地忽略这个警告,它不会影响到你使用git克隆仓库。如果你已经成功克隆了仓库,那么一切都在正常工作。如果你在克隆过程中遇到其他问题,那可能需要查看具体的错误信息来解决。
1154 9
|
网络安全 开发工具 数据安全/隐私保护
Win10使用Git克隆项目出现fatal: Authentication failed for异常
Windows 10系统中使用Git克隆项目时出现"fatal: Authentication failed for"异常的解决方法,主要是通过修改凭据管理器中的Git凭据密码来解决因密码过期导致的身份验证失败问题。
1470 0
Win10使用Git克隆项目出现fatal: Authentication failed for异常
|
网络安全 开发工具 git
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
6845 1