2017-06-08 7 views
1
Windows 10 
Git for Windows 64 v2.13.0.windows.1 

config ssh mit Private-Key Passwort findet Ich folge dieser GitHub doc:Fenster git bash beim Start nicht agent.env

https://help.github.com/articles/working-with-ssh-key-passphrases/

Insbesondere füge ich meine ~/.ssh/.bashrc das folgende Skript:

env=~/.ssh/agent.env 

agent_load_env() { test -f "$env" && . "$env" >| /dev/null ; } 

agent_start() { 
    (umask 077; ssh-agent >| "$env") 
    . "$env" >| /dev/null ; } 

agent_load_env 

# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running 
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?) 

if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then 
    agent_start 
    ssh-add 
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then 
    ssh-add 
fi 

unset env 

Allerdings, wenn ich Git Bash starten kann es nicht ~/.ssh/agent.env finden:

Was ist agent.env und wie ist es normalerweise installiert oder was sollte es enthalten?

Antwort

0

Punkt ssh-add auf die Datei, zB ssh-add ~/.ssh/id_rsa oder c:/somenondefaultlocation/.ssh/id_rsa

if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then 
    agent_start 
    ssh-add 
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then 
    ssh-add 

Also, stellen Sie sicher, dass Sie das gleiche Verzeichnis für die erste Zeile gesetzt, zB env=~/.ssh/agent.env oder env=c:/somenondefaultlocation/.ssh/agent.env