79402766

Date: 2025-01-31 12:46:32
Score: 0.5
Natty:
Report link

For Linux and Windows WSL users (may work on Mac but untested)

  1. Download this ssh agent key caching script I created to your ~/.ssh/ folder

    key_agent.sh

  2. Link to it in your ~/.bashrc by adding these lines to the end of the file

    # Load the SSH key agent management script
    if [ -f "$HOME/.ssh/key_agent.sh" ]; then
      . "$HOME/.ssh/key_agent.sh"
    fi
    
  3. Finally in your terminal, set git to always use the ssh-agent by running the following

git config --global core.sshCommand "ssh -o IdentityAgent=$SSH_AUTH_SOCK"

The key agent script will check whether keys are already loaded and if so apply them to the current terminal or if not load any of the keys that have not been loaded and apply them.

Reasons:
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: eodeluga