Open ghost opened 5 years ago
Have you tried setting LPASS_DISABLE_PINENTRY=1
as per: https://github.com/lastpass/lastpass-cli/blob/8d91585219e9e757fae1ced7477d6a3736db4e44/lpass.1.txt#L84-L86
You should be able to run it like:
$ echo 'PASSWORD' | LPASS_DISABLE_PINENTRY=1 lpass login MYEMAIL
or by setting the environment variable for your shell (export LPASS_DISABLE_PINENTRY=1
in ~/.profile
or similar).
try this Im using it in an automated pipeline with no issue, obviously set your variables and you will need the var that @msbit has already mentioned,
# linux/bash
export LPASS_DISABLE_PINENTRY="1"
LOGGED_IN=$($LPASS_HOME/lpass login "$LASTPASS_USER" <<<"$LASTPASS_PASSWORD")
echo $LOGGED_IN
# windows/powershell
$env:LPASS_DISABLE_PINENTRY = "1"
$LOGGED_IN = echo $LASTPASS_PASSWORD | & lpass login $LASTPASS_USER
Write-Host $LOGGED_IN
The password I was given included a !
which caused issues inside of double-quotes, which was causing the same Failed to enter correct password
error. If you suspect your shell is mangling the password, try passing it to cat
and check the output:
cat <<<"$PASSWORD"
See also https://stackoverflow.com/questions/11025114/how-do-i-escape-an-exclamation-mark-in-bash
Hi, when trying to login using the non-interactive way : echo 'PASSWORD' | lpass login MYEMAIL it keeps returing me this error : Error: Failed to enter correct password.
CentOS Linux release 7.6.1810 (Core) LastPass CLI v1.3.1