Lastpass Ssh

  1. Lastpass Share Password With Family
  2. Lastpass Share Password


The purpose of this post is to learn how to easily store SSH keys in LastPass using their command line client lpass.

The lastpass command line client The folks at LastPasshave had the good idea to release an open source command line client called lpass. With this tool we can easily query LastPass from the command.

Before you begin

  • The LastPass community is the best place to share your knowledge and feedback, ask questions or get for advice from fellow LastPass users.
  • With an integrated single sign-on and password manager solution, LastPass Enterprise provides control for every access point.

A Linux machine is required to follow this tutorial.

Step 1 - Create a SSH key pair (public/private)

Run ssh-keygen setting a passphrase and a destination (by default ~/.ssh/id_rsa and ~/.ssh/ We strongly recommend to add a strong passphrase, to do it you can use pwgen or apg binaries for example.

Double check ssh-keygen created a private and public key files.

Step 2 - Install LastPass CLI

It’s true that there is still no LastPass CLI package for Debian/Ubuntu . BUT there are LastPass CLI packages for other OS like Fedora, Arch, Fedora, OS X and many more. More info on its GitHub page: Short Nights of the Shadow Catcher PDF Free download.

There is no binary for Debian/Ubuntu, you should install first the dependencies and build the client from its repo:

More information about LastPass cli here.

Step 3 - Store SSH keys to LastPass

Log in to LastPass:

Enter master password, accept verification email (only first time) and 2 factor authentication if needed.

Running the following command you’ll create a SSH-Key secure note.

Previous comment was fixed thanks to @christopher_howie.

This note will be uploaded automatically to your LastPass Vault, depending on your version of LastPass CLI you should run lpass sync as well.

This post is using ~/.ssh/ and cat ~/.ssh/ please change previous paths to your current SSH key destination paths.

Lastpass Share Password With Family

Go to your LastPass Vault and make shure the ${passhprase} is there. If you cannot see the key, sometimes we might trigger the Refresh Site option going to More options > Advance > Refresh Site on the UI.

Lastpass Share Password

Finally, to do a quick search by command line you could use lpass together with grep: