In this tutorial, we are going to show you how to install latest version of LastPass CLI in Linux and how to use it to list, display and create passwords or secure notes.
01./ How to Install LastPass CLI
Install LastPass CLI on Red Hat/Centos
01- First, we need to install the EPEL release repository:
# sudo yum install epel-release ## Red Hat/Centos 7 # sudo dnf install epel-release ## Red Hat/Centos 8
02- Once you enabled the EPEL repository, use the below command to install lpass
:
# sudo yum install lastpass-cli ## Red Hat/Centos 7 # sudo dnf install lastpass-cli ## Red Hat/Centos 8
Install LastPass CLI on Debian/Ubuntu
01- Use the below commands to install lpass
:
# sudo apt update # sudo install lastpass-cli
02./ How to Use LastPass CLI
– Check the version of LastPass CLI:
# lpass --version LastPass CLI v1.3.3.GIT
– Login to LastPass:
# lpass login USERNAME ## # lpass login [email protected]
– To list all the passwords and secure notes:
# lpass ls
– You could use lpass
together with grep
to do a quick search:
# lpass ls | grep YOUR_KEY ## # or a case-insensitive search ## # lpass ls | grep -i YOUR_KEY
– To display a password or a secure note:
# lpass show YOUR_KEY ## or # lpass show YOUR_KEY_ID
– Generate a new password:
# lpass generate mypassword 16 zo4*c;A+g;KIHkO-
– Create a secure note type ssh key with an interactive mode:
# lpass add --sync=now --note-type=ssh-key YOUR_KEY_NAME
Conclusion
You have successfully learned how to install LastPass CLI on your Linux machine. You can view the full documentation form the official website.
You might want to check the following guides: