lastpass / lastpass-cli

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

Is there a straightforward way to use LastPass CLI as a non-root user please? #611

Open 8uachaille opened 2 years ago

8uachaille commented 2 years ago

I’d like to use LastPass as a non-root user

I set up the following

[root@hoo ~]# tail /etc/sudoers boo ALL=(ALL) NOPASSWD: /bin/lpass login boo ALL=(ALL) NOPASSWD: /bin/lpass sync boo ALL=(ALL) NOPASSWD: /bin/lpass add

[boo@hoo ~]$ sudo /bin/lpass login myuser@mydomain.com Error: Failed to enter correct password.

—> The above challenges me for my password but fails to accept my password and throws Err: You may have mistyped your email address. Try again.

[boo@hoo ~]$ /bin/lpass login myuser@mydomain.com Error: Failed to enter correct password.

—> The above does not prompt me for a password and simply throws the error

lpass binary permissions are world executable

[boo@hoo ~]$ ls -lart /bin/lpass -rwxr-xr-x. 1 root root 181336 Jul 2 2018 /bin/lpass

I imagine the first error has something to do with an authenticated token being passed to the root user during the sudo cmd execution and that token being unavailabe to user boo

Is there a straightforward way to use LastPass CLI as a non-root user please?

hymie0 commented 2 years ago

As far as I know, lpass doesn't need root privileges. What happens when you just run it without sudo?