AddPassphraseToSshAgent

nicolaw 16th August 2018 at 10:50am
CodeSnippets
eval $(ssh-agent)
install -vm700 <(printf 'echo "%s"\n' "$SSH_PASSPHRASE") ~/.passphrase
cat "$SSH_PRIVATE_KEY" \
  | DISPLAY=":0" SSH_ASKPASS=~/.passphrase ssh-add - \
  && rm -fv ~/.passphrase
ssh-add -l