Files
arthur-os/bin/omarchy-remove-security-fido2
T
David Heinemeier HanssonandGitHub 45db959daf Split fido2 and fingerprint setups into setup and remove (#5670)
* Split fido2 and fingerprint setups into setup and remove

Don't make one thing do two things

* Extract helpers and clean up

* No need to hide them

* Don't need these
2026-05-08 16:41:20 +02:00

36 lines
923 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Remove FIDO2 authentication from sudo and polkit
# omarchy:requires-sudo=true
set -e
remove_pam_config() {
# Remove from sudo
if grep -q pam_u2f.so /etc/pam.d/sudo; then
omarchy-echo-info "Removing FIDO2 authentication from sudo..."
sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/sudo
fi
# Remove from polkit
if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_u2f.so' /etc/pam.d/polkit-1; then
omarchy-echo-info "Removing FIDO2 authentication from polkit..."
sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/polkit-1
fi
}
omarchy-echo-success "Removing FIDO2 device from authentication.\n"
remove_pam_config
if [[ -d /etc/fido2 ]]; then
omarchy-echo-info "Removing FIDO2 configuration..."
sudo rm -rf /etc/fido2
fi
omarchy-echo-info "Removing FIDO2 packages..."
omarchy-pkg-drop libfido2 pam-u2f
omarchy-echo-success "FIDO2 authentication has been completely removed."