Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
SSH key management with LastPass
Ruby Shell Makefile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin add 2018 Jun 28, 2018
scripts Force lpass login. Sep 15, 2015
template Add 2 more examples in case people want to write their own tools. Aug 28, 2015
tests Build lpass as a separate subprocess. Sep 15, 2015
.travis.yml
LICENSE Initial commit Aug 27, 2015
README.md Add a link to the blog post. Mar 8, 2017
lastpass-ssh.gemspec
makefile Add install/uninstall targets. Mar 5, 2017

README.md

SSH key management with LastPass

Build Status

This repository has a tool called lastpass-ssh which integrates LastPass with SSH. You store your SSH key passphrases in LastPass, and SSH key files somewhere else. To start using SSH, you type lastpass-ssh and it will unlock all SSH keys with appropriate passphrases taken from LastPass.

How to install

Install the LastPass command line client (lpass) from a lastpass-cli package and lastpass-ssh Gem:

brew install lastpass-cli
gem install lastpass-ssh

Setup

You make yourself an "SSH" subfolder in the LastPass' "Secure Notes" and add secure notes there. Each note has a name and a passphrase. The name corresponds to the filename of the SSH key file, and the passphrase is its key's passphrase.

Example: if you have a key like myrepos in ~/.ssh/, then the name of the Secure Note would be myrepos.

How to use

Run:

lastpass-ssh

It will poll the "Secure Notes/SSH" folder and for each note of name "A", it'll try to perform ssh-add ~/.ssh/A with an appropriate passphrase.

You can change the location of keys by passing --keys-path=<where-you-have-keys>. By default all keys are added. You can change this behavior by passing --key=KEYNAME option, where KEYNAME is the name of the key file you want to add.

Learn more

I wrote an article on lastpass-ssh.

Details

Internally the lastpass-ssh script is based on the lpass command line tool provided by LastPass team themselves.

Author

You can’t perform that action at this time.