Skip to content

u/KIMOOTA

In this archive from Jan 2018 to May 2020

4
posts
41
comments
4
media
1.1k
score

Top posts

Top comments

Both SDDM and the lock screen (if that was what you meant) use system-auth. Most of the time system-auth and possibly sudo are the only files you would want to modify.

I use YubiKey and I'd like to use 2FA (password & challenge-response) for initial logins (via SDDM or console) but 1FA (Yubico OTP) for lock screen and sudo, so here's what I have in system-auth:

auth      [success=2 default=ignore]    pam_exec.so     quiet /usr/local/bin/isloggedin
auth      required                      pam_unix.so     try_first_pass nullok
auth      [success=1 new_authtok_reqd=1 ignore=ignore default=die] pam_yubico.so mode=challenge-response
auth      required   pam_yubico.so      id=xxx key=xxx authfile=/etc/yubico/authorized_yubikeys
auth      optional   pam_permit.so
auth      required   pam_env.so

btw /usr/local/bin/isloggedin:

#!/usr/bin/env bash

CHK_USER="$1"
if [[ -z "$CHK_USER" ]]; then
    CHK_USER="$PAM_USER"
fi
if [[ "$CHK_USER" =~ ^[0-9]+$ ]]; then
    CHK_USER=`id -un "$CHK_USER"`
fi

if [[ -z `w -sh "$CHK_USER"` ]]; then
    exit 1
else
    exit 0
fi

So [success=2 default=ignore] means if isloggedin returns success, skip the following 2 lines and use pam_yubico.so id=xxx key=xxx for 1FA; otherwise silently ignore its result and proceed onto pam_unix.so and pam_yubico.so mode=challenge-response.

Back to your case, if you want your facial recognition only for lock screen, simply use my script and replace pam_yubico.so id=xxx key=xxx with yours.

13 points
" Import defaults.vim
if has('mac')
  let s:defaults = system('find -L /usr/local/share/vim -type f -name "defaults.vim"')
else
  let s:defaults = system('find -L /usr/share/vim -type f -name "defaults.vim"')
endif
exec 'source ' . s:defaults

What I have in my vimrc. I don't remember if macOS ships a built-in vim but if not those 2 finds can be merged I think.

11 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.