lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.85k stars 292 forks source link

Setting LPASS_AGENT_TIMEOUT does not preserve login #501

Open kratsg opened 5 years ago

kratsg commented 5 years ago

Hi,

I like to be able to run lpass login for a given day and have subsequent password accesses (such as for ssh) to not require the lpass login password. So I do something like this:

LPASS_AGENT_TIMEOUT=86400 lpass login --trust <username>

However, immediately after running, a subsequent lpass show <account> still prompts for my password. I would like to basically just remember the password for 1 day (86400 seconds) and type it in once. For reference, I have an ssh command like this (for a server that only allows passworded logins)

sshpass -f <(lpass show --password <account>) command ssh <server>

Related: #499, #270.

waterkip commented 5 years ago

I seem to be able to trigger this as well, not on the first run. testcase:

lpass logout
lpass login --trust username@lastpass.com
while : ; do; pgrep -lf lpass;
    lpass show --username --sync=auto <SITE>
    sleep 10
done
Are you sure you would like to log out? [Y/n] y
Log out: complete.
Success: Logged in as username@lastpass.com.
7624 lpass [agent]
waterkip
7624 lpass [agent]
7628 lpass [upload q
waterkip
7624 lpass [agent]
7628 lpass [upload q
waterkip
7624 lpass [agent]
7628 lpass [upload q
waterkip
7624 lpass [agent]
7628 lpass [upload q
waterkip
7624 lpass [agent]
7628 lpass [upload q
waterkip
7628 lpass [upload q
Please enter the LastPass master password for <username@lastpass.com>.
Master Password:
tedwardd commented 4 years ago

This issue persists in LastPass CLI v1.3.3.GIT. The agent does appear to be running in the background but not providing authentication.

richardpickett commented 3 years ago

Two years later, seems the same.