feat: add YubiKey pam_u2f setup
Type of Change
YubiKey PAM Setup Utility
- Added a new entry for
YubiKey PAM Setuptocore/tabs/utils/tab_data.toml, enabling selection from the utility tab. - Created the script
core/tabs/utils/yubikey-pam-setup.shto automate configuration of PAM files for YubiKey authentication, including interactive target selection, backup of relevant files, deduplication of PAM config entries, secure enrollment, and rollback guidance.
Documentation
- Updated
docs/userguide.mdto describe the new YubiKey PAM Setup utility and its purpose.] New feature
- [x] Added new feature
- [ ] Bug fix
- [x] Documentation update
- [ ] Refactoring
- [ ] Hotfix
- [ ] Security patch
- [ ] UI/UX improvement
Description
This pull request adds a new utility for "YubiKey PAM setup", allowing users to configure sudo and other PAM targets to require YubiKey (U2F) touch authentication with password fallback. The main changes include introducing the setup script, updating configuration files to register the new utility, and documenting its usage.
Testing
Tested on Arch (CachyOS to be specific). Sudo and system-auth were tested and are working. Debian and Fedora not yet tested.
Impact
A new YubiKey PAM setup option now appears in Utilities, PAM configs/backups get touched when run.
Issues / other PRs related
system-auth: The script does not yet handle avoiding duplication of lines in the system-auth file correctly like it does for sudo
Additional Information
Checklist
- [ ] My code adheres to the coding and style guidelines of the project.
- [x] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [x] I have made corresponding changes to the documentation (
cargo xtask docgen). - [x] My changes generate no errors/warnings/merge conflicts.
i'm sorry but there is no way i'm ever approving something like this...
- this doesn't adhere our code style at all
- it's clearly all ai
- what even are those comments supposed to be
- a LOT of unnecessary code, practically unmaintainable
not closing this just in case you want to rewrite it all by hand and make it make sense
Sorry, this was my first PR. I'll work on it.
Wow, this is a terrible PR. Some feedback before closing this and future PRs:
- First only change 1 thing and make a PR on that. Making a "nuke the world" commit like this would completely screw up all of the project and cause massive issues for everyone (contributors, users, etc.)
- Using AI to add over 8,000 lines of code is just terrible. Using AI to remove a few lines and make a concise PR is ok as long as it is testing and doesn't add tech debt or "bloat".
- Look at past examples of scripts and follow the structure of those scripts. Do NOT just make entire new structure and ignore all the current scripts.
- You are mixing POSIX and bash compliance in and out of all the scripts. POSIX compliance helps make sure all the scripts run on all shells or at least the most used ones. Bash compliance generally only works with people using bash.