Created
January 26, 2017 13:30
-
-
Save husobee/c375d73316c30fc40279fcee44bdfffb to your computer and use it in GitHub Desktop.
using passwordstore with ssh-add
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PASS_NAME=$1 | |
KEY_FILENAME=$2 | |
# start ssh-agent | |
eval `ssh-agent -s` | |
# decrypt the rsa private key, using the password from the `pass` command by means of a named pipe | |
openssl rsa -inform PEM -passin file:<(pass show ${PASS_NAME}) -in ${KEY_FILENAME} -text | ssh-add - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the idea! I kept getting errors with
openssl
, so here's my approach, usingexpect
:https://gist.github.com/georgjaehnig/217c004decb58877a2eebd05788d1dee