Trying bw CLI and cannot log in

Because of the current issue (bug) with the json export from the desktop application not working on Linux Mint 22.3, I decided to try the CLI. 1st step is to log in. I am failing on step 1…

I tried

bw login my@email my_password --method 0 --code authenticator_code

and

bw login

and

bw login --method 0

I always end up with a “Username or password is incorrect. Try again.” error. The same username and password work fine with the web, desktop app, and mobile app.

What am I doing wrong?

I don’t use Linux, but have you tried putting my@email and my_password in quotes? i.e.

bw login “my@email” “my_password” --method 0 --code authenticator_code

@the1avi Did you connect to the correct server first?
(–> https://bitwarden.com/help/cli/#config)

Yes, I tried this with the same result, but it was a good suggestion.

bw config server

displays the default

https://bitwarden.com

Which I assume it is correct for the US.

I would guess that you are, indeed, entering the wrong email or password for the server where you are trying to login, the syntax of your first try (bw login my@email my_password --method 0 --code authenticator_code) is correct.

I don’t know, try logging in with your API Key to rule out some things.

When I tried with the API KEY I received a weird error:

No client version header found, required to prevent encryption errors. Please confirm your client is supplying the header: “Bitwarden-Client-Version”

That was a strange one so I decided to dig further and what I realized was that the bw CLI program is not part of the Bitwarden .deb distribution and that it needs to be installed separately. Apparently, long time ago, I installed bw and there was a mismatch between the current Bitwarden and old bw versions. Once I installed the latest bw version I was able to login. bw is part of the flatpak distribution but because of a bug, the flatpak version doesn’t work with fingerprint scanners while the .deb works with the scanner but is missing bw.

Bitwarden (the company) needs to work towards consistency. Both .deb and flatpak should contain the same programs, and both should support auto-update.