Skip to content

Instantly share code, notes, and snippets.

@inamesh
Created June 18, 2020 09:36
Show Gist options
  • Save inamesh/3b058c715f0564c8cca78d4656e3fb5b to your computer and use it in GitHub Desktop.
Save inamesh/3b058c715f0564c8cca78d4656e3fb5b to your computer and use it in GitHub Desktop.
Avoid running ssh agent and attaching keys every time on Raspberry Pi
#Helper script from GitHub
# source: https://github.com/wwalker/ssh-find-agent
# (blog: http://blog.joncairns.com/2013/12/understanding-ssh-agent-and-ssh-add/)
#- Used in the 'Actions' section
. ~/scripts/ssh-find-agent.sh
## Setup outbound SSH. Run ssh agent and add keys
# This is only needed if agent is not running (e.g. after a reboot)
sshout () {
eval $(ssh-agent);
ssh-add ~/.ssh/pi2_cloud;
ssh-add ~/.ssh/pi2_local;
}
# Find the currently running ssh agent and attach it!
ssh_find_agent -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment