Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[Mint] Install Bitwarden-CLI on Linux Mint 19.2 Cinnamon

Find their Github here and their Documentation here. They recommend to install via NPM. So first we have to install the Node.js runtime if you have not yet.
If you follow the Node.js installation guide you would use:

sudo apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -

But this will lead into the following, since 19.2 Tina is not yet support (on 19.1 Tara it will run fine).

## Confirming "tina" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_12.x/dists/tina/Release'

## Your distribution, identified as "tina", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support

So we have to do it manually. I used this little how-to i found on Github:

# Add missing signature
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 1655A0AB68576280

# Replace misconfigured  sources file. Change version of node you like to have. 8/10/12
echo -e "deb https://deb.nodesource.com/node_10.x bionic main" | sudo tee /etc/apt/sources.list.d/nodesource.list
echo -e "deb-src https://deb.nodesource.com/node_10.x bionic main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list

# Update packages and install
sudo apt update
sudo apt install nodejs

Finally install Bitwarden-CLI with a single line.

sudo npm install -g @bitwarden/cli

Now you can login into Bitwarden. If you have enabled any two-step login method, you have to add the parameter “–method” and a specific value for the login in method you can find here. In my case “0”, as I’m using TOTP.

bw login --method 0

If you successfully logged in, you will get your session key and are able to read your passwords:

To unlock your vault, set your session key to the `BW_SESSION` environment variable. ex:
$ export BW_SESSION="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
> $env:BW_SESSION="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
You can also pass the session key to any command with the `--session` option. ex:
$ bw list items --session xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Leave a Reply

Your email address will not be published. Required fields are marked *