Repository navigation
Skip the fingerprint prompt for sudo in remote (SSH, Tern) sessions #17689
rblaine95
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
System details: Dell Latitude 3440, i7-1355U, Omarchy 4.5.0, fprintd 1.94.5, kernel 7.2.15
When I connect to my laptop remotely, over SSH or a Tern remote host connection,
sudostill asks me to touch the fingerprint reader first. I'm not near the reader, so I have to press Ctrl+C or wait 30 seconds forpam_fprintdto time out before I get the password prompt.The clamshell gate already skips fingerprint when the lid is closed. A second gate could skip it in remote sessions. I've been using this in
/etc/pam.d/sudo, above the clamshell line:Tern remote panes run under the user's systemd manager, not sshd, so they have no
SSH_*variables. They do setTERN_IDENTITY, a list of hops. Each hop has amethod:local,ssh-key, ortailscale. The check treats a pane as remote when it has anssh-keyortailscalehop. It ignores the hop'sfromfield, which isrelayfor relayed connections and the client's IP for direct ones. A hop method the check doesn't know falls back to fingerprint. If Tern has a more direct way to say "this pane is remote", that would be a better thing to check.It needs
seteuidbecause sudo is setuid, and only root can read its/proc/<pid>/environ. If the script fails, PAM ignores it and the stack behaves as it does today. Setting either variable yourself only skips straight to the password, so faking it gets you nothing.Limitations: this doesn't help polkit, because
polkit-agent-helper-1gets a cleaned environment. It also has the same exit-1 journal noise as the clamshell gate (#10254).All reactions