Jay Taylor's notes
back to listing indexSSH agent forwarding and screen
[web search]
Original source (gist.github.com)
Clipped on: 2017-06-19
found here: https://gist.github.com/duijf/baeeec8197cdf81448370cf33dc0e708
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
}
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent
fi
atm idk how to pair this with tmux, someone?
Or adopt this awesomeness: https://github.com/wwalker/ssh-find-agent