My GitBash SSH environment always asks for my passphrase, what can I do?
It is a good idea to configure your GitBash shell to automatically start the agent when you launch GitBash. The
.bashrc file is the shell initialization file. It contains commands that run each time your GitBash shell starts. You can add commands to the
.bashrc file that start the agent when you start GitBash. The folks at GitHub have developed a nice script for this (their script was developed from a post by Joseph M. Reagle Jr. from MIT on the cygwin list). To start the agent automatically, do the following.
- Start GitBash.
Edit yourIf you don't have a
.bashrcfile you can create the file using your favorite text editor. Keep in mind the file must be in your
~(home) directory and must be named exactly .
Add the following lines to the file:
- Save and close the file.
- Close GitBash, then reopen GitBash.
The system prompts you for your passphrase:
- Enter your passphrase.
After accepting your passphrase, the system displays the command shell prompt.
Verify that the script identity added your identity successfully by querying the SSH agent:
$ ssh-add -l
2048 0f:37:21:af:1b:31:d5:cd:65:58:b2:68:4a:ba:a2:46 /Users/manthony/.ssh/id_rsa (RSA)
Was this helpful?
Thanks for your feedback!