Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompted for password even if non is required #36

Open
WhyNotHugo opened this issue Feb 17, 2021 · 12 comments
Open

Prompted for password even if non is required #36

WhyNotHugo opened this issue Feb 17, 2021 · 12 comments

Comments

@WhyNotHugo
Copy link

I've sudo set up so that I can sudo by just pressing my Yubikey's button.

However, when I run SudaWrite, I'm always prompted for a password. I can type any gibberish though, and then pressing the key lets sudo operate properly.

How about not asking for a password is sudo does not require one?

@zeertzjq
Copy link
Contributor

I use fprintd with sudo and I also have this problem. According to the discussions in #34 i guess it is very hard to determine whether sudo requests a password, so an extra configuration option may be the easiest way to solve this.

@WhyNotHugo
Copy link
Author

an extra configuration option may be the easiest way to solve this.

That would partially work. If my yubikey is not plugged it, sudo falls back to asking for a password, so that scenario would not work. I guess if a fingerprint reader is built into the keyboard that wouldn't be an issue in that case though.

@zeertzjq
Copy link
Contributor

zeertzjq commented Feb 18, 2021

an extra configuration option may be the easiest way to solve this.

That would partially work. If my yubikey is not plugged it, sudo falls back to asking for a password, so that scenario would not work. I guess if a fingerprint reader is built into the keyboard that wouldn't be an issue in that case though.

Oh, then maybe another option is to make sudo read from an empty stdin first. Changing -n to -S in this line should be enough. When stdin is empty, sudo will fail to read a password and exit directly, while authentication methods that come before password can still work. (Unlike -n which also suppresses other stuff like fingerprint authentication.)

I'm not familiar with YubiKey. When using fprintd the solution above causes the editor to freeze until a fingerprint is scanned, so such a solution works, but is not user-friendly.

@zeertzjq

This comment has been minimized.

@zeertzjq

This comment has been minimized.

@zeertzjq
Copy link
Contributor

zeertzjq commented Apr 3, 2021

Another option may be to allow using an external terminal emulator or tmux to run sudo, so that the plugin doesn't need to care about what sudo expects at all.

@WhyNotHugo
Copy link
Author

Actually, even using a new split with a terminal that does the sudo might be a good idea.

It'd also improve the experience with failed password attempts.

@fidgetingbits
Copy link

This is an issue when using howdy as well, as you generally want sudo to automatically authenticate without asking for the password.

@d0wn2
Copy link

d0wn2 commented Oct 5, 2021

Any updates on this? I also use fprintd and when saving via Suda it prompts for the password first, then attempts to authenticate via the fingerprint sensor, and ultimately doesn't even save the file.

@aarondill
Copy link
Collaborator

is this fixed after #69?

@sstark
Copy link
Contributor

sstark commented Mar 23, 2024

is this fixed after #69?

I'd say no, the change is mostly unrelated. If you have authenticated before and the authentication token is still valid, it will not ask for a password/fingerprint/yubikey. But if sudo wants you to authenticate, suda still behaves as before.

But isn't this what the option g:suda#nopass is for?

@aarondill
Copy link
Collaborator

@sstark not quite. this is an issue we're currently working on actually. please see this comment for a description of how it actually works: #61 (comment)

and if you can come up with a better name, we're looking for one at #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants