Sufficient conditions for 1 and 2 to “just work”
- you are using some version of linux
- you ran
ssh-keygen
and hit enter until the prompts stopped- ensure that
~/.ssh/id_rsa
exists afterward
- ensure that
- you have followed these instructions for key exchange with github
1. Single session (interactive, works until you reboot):
run the following two lines (in order):
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
2. Every session (non-interactive, runs at boot):
copy the following into your ~/.bashrc
, then restart:
SSH_ENV="$HOME/.ssh/agent-environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi