apt install libengine-pkcs11-openssl gnutls-bin opensc-pkcs11 scdaemon opensc libpam-p11 libpam-u2f pamu2fcfg ssh
snap list firefox >/dev/null 2>&1 && sudo snap remove --purge firefox || true
sudo apt remove --purge -y firefox firefox-locale-* || true
sudo apt install -y flatpak plasma-discover-backend-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub org.mozilla.firefox
# 6) Rebuild KDE app menu cache (so Firefox shows in launcher)
kbuildsycoca6 2>/dev/null || kbuildsycoca5
install the packages
use flatpak firefox
install keepassxc and firefox extension
kwallet password set to empty string
setup libpam-p11 and/or fido2 in pam
configure luks2 unlock with tpm/smartcard
install tarsnap for backups
A note about kwallet. I don't want it. I don't use it and it won't go away. In the past--with varying degrees of success--I have:
disabled in system settings
deleted files from random locations based on web searches
set specific commands in files
set a blank password after every password reset
Here are some specifics
rm ~/.local/share/kwalletd/kdewallet.kwl
It should be trivial to connect the tpm to the current encrypted looks root volume but it depends greatly on what boot process your distro is using. The best way to use the tpm feature is for the boot process to check signatures. Unfortunately, most distros do not protect the initrd so a compromised boot process means we cannot trust the signature check. The best we can do right now, is use the tpm signature to make it safer to unlock the luks drives without a passphrase.
systemd-boot supports decrypt of LUKS partitions via tpm. Most distros like Kubuntu 26.04 are not using systemd in boot--which is fine because i have my own utility to add support for tpm2 to initramfs-tools. After I install the deb I enroll the tpm for my luks2 volume using the standard systemd-cryptentroll. Then I rebuild the initrd. My utility adds hooks to initrd rebuild to add the tpm2 support along with other types of luks unlocking.
sudo add-apt-repository ppa:jtmoree/security-tools
sudo apt update
sudo apt install luks-root-smartcard-tools
dev=/dev/nvmen1p7
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=7 $dev
sudo update-initramfs -u -k "$(uname -r)"
Unfortunately, the initrd is NOT protected by 99% of the Linux distros. The only systems I know of that tackle this issue are PureOS and the heads project--both of which require specific hardware. This leaves the rest of us unprotected. Unified Kernel Images are probably the best solution to this problem but they introduce other problems...
some of my systems have an older tpm and systemd wont use it. I use smartcards and fido2 devices to get the same convenient unlock without a passphrase.
I have a ppa with packages for this
https://launchpad.net/~jtmoree/+archive/ubuntu/security-tools
My custom unlock processes leverages luks2, gpg, smartcards, systemd tokens, and initramfs to unlock during boot without requring systemd in the boot process.
gpg keyfile and luks2 gpg token
tpm systemd token
systemd-pkcs11
systemd-fido2
I hope to get ubuntu to accept my packages since debian is moving to dracut and ubuntu is not ready for that. I could not get dracut to work at all when I tried it. I may revisit that.
sudo apt install libfido2-1 fido2-tools
sudo add-apt-repository ppa:jtmoree/security-tools
sudo apt update
sudo apt install luks-root-smartcard-tools
dev=/dev/nvmen1p7
sudo systemd-cryptenroll --fido2-device=auto "$dev"
sudo update-initramfs -u -k "$(uname -r)"
I configure multiple types of devices in common-auth to allow options. Generally using fido2 and p11 for this. Here is the pam config
# smartcard logins allowed with fallback
auth [success=done authinfo_unavail=ignore user_unknown=ignore default=ignore] pam_u2f.so cue authfile=/etc/u2f_mappings pinverification=1 userverification=0
auth [success=done authinfo_unavail=ignore user_unknown=ignore default=ignore] pam_p11.so opensc-pkcs11.so
# here are the per-package modules (the "Primary" block)
auth [success=done default=ignore] pam_unix.so try_first_pass nullok
auth [success=1 default=ignore] pam_unix.so nullok try_first_pass
Whichever is found first is tried. I can unplug if one isn't working.
Though it is useful to protect the private key with the smartcard I'm already using encrypted partitions for storing keys. Using the smartcard with SSH does not bring much value to me. It would add an extra layer of protection in the case of a system compromise but not much. maybe I'll do it at some point.
apt install openssh
dnf install openssh-server
Some of the smart cards have password manager features. I have not been able to get this to work with mine and so I use a password vault with the data stored in a LUKS volume.
Documented Challenges with setting numlock ON by default.