- Install
lpass
, the last pass command line tool
brew install lastpass-cli --with-pinentry
-
Create a passphrase encrypted key and make sure you put the public key where you need it, eg: github
-
Come up with a name for your lastpass shared note that is easy to search for.
-
Create a lastpass shared note (use the web ui) from the template
2.lastpass-ssh-tool.sh
included below. -
Replace {{USER-ID}} with your lastpass login email.
-
Replace {{NOTE-NAME}} with the name of your lastpass shared note.
-
Replace {{PRIVATE-KEY}} with your ssh private key:
KEY=$(cat <<-'EOF'
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,ETC....
3jEULKvVju0/SUEvv8CAbmGV5IskohMl3Nv3jEULKvVju0/SUEvv8CAbmGV5Isk1
........................
hu1rncm8AsfTvT2fr9ubHdo37JNSgPj4xGwkgnr9FCV7+AklMcHJMrSd8WoQwUMO
-----END RSA PRIVATE KEY-----
EOF
)
- Save your shared note
- Open your lastpass vault or chrome extension and search for your shared note
- Copy the first line of the shared note, without the
#
- Paste into your terminal
- Respond with your lastpass password
- Respond with your ssh key passphrase.