Yubikey MFA setup script assistance

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
madelinesaxen
Level 1
Level 1
Posts: 5
Joined: Fri Jun 02, 2023 3:01 am
Location: Texas, United States

Yubikey MFA setup script assistance

Post by madelinesaxen »

I just got into shell scripting, and I'm wishing to create a script that will enable multi factor authentication with my Yubikey 5 NFC on my personal desktop/server. Previously, I had issues being soft-locked out of my device using multiple different guides, so I decided to create my own script.

I'd prefer to use Yubico PAM as the authentication medium, however, I do not think that would be possible considering most f the guides I have tried use PAM.

What would be the best method to approach this? I only need basic information to go from there, but any form of help is acceptable. :D


System Info

Code: Select all

System:
Kernel: 5.15.0-56-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Cinnamon 5.6.8 tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy

Machine:
Type: Desktop Mobo: Gigabyte model: B550I AORUS PRO AX v: x.x serial: UEFI: American Megatrends LLC. v: F15 date: 01/04/2022

CPU:
Info: 8-core model: AMD Ryzen 7 3700X bits: 64 type: MT MCP arch: Zen 2 rev: 0 cache: L1: 512 KiB L2: 4 MiB L3: 32 MiB Speed (MHz): avg: 3193 high: 3194 min/max: 2200/3934 boost: enabled cores: 1: 3194 2: 3193 3: 3193 4: 3193 5: 3194 6: 3194 7: 3194 8: 3193 9: 3194 10: 3194 11: 3194 12: 3194 13: 3194 14: 3193 15: 3194 16: 3194 bogomips: 102208 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm

Graphics:
Device-1: NVIDIA TU116 [GeForce GTX 1660 Ti] vendor: ASUSTeK driver: nouveau v: kernel pcie: speed: 2.5 GT/s lanes: 16 ports: active: DP-1 empty: DP-2,HDMI-A-1,HDMI-A-2 bus-ID: 0b:00.0 chip-ID: 10de:2182 Device-2: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo bus-ID: 5-1:2 chip-ID: 046d:0825 Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: modesetting unloaded: fbdev,vesa gpu: nouveau display-ID: :0 screens: 1 Screen-1: 0 s-res: 1920x1080 s-dpi: 96 Monitor-1: DP-1 model: AOC 24G1WG4 res: 1920x1080 dpi: 94 diag: 598mm (23.5") OpenGL: renderer: NV168 v: 4.3 Mesa 22.2.5 direct render: Yes

Audio:
Device-1: NVIDIA TU116 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: speed: 2.5 GT/s lanes: 16 bus-ID: 0b:00.1 chip-ID: 10de:1aeb Device-2: AMD Starship/Matisse HD Audio vendor: Gigabyte driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16 bus-ID: 0d:00.4 chip-ID: 1022:1487 Device-3: Corsair HS80 RGB Wireless Gaming Receiver type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-5:2 chip-ID: 1b1c:0a73 Device-4: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo bus-ID: 5-1:2 chip-ID: 046d:0825 Sound Server-1: ALSA v: k5.15.0-56-generic running: yes Sound Server-2: PulseAudio v: 15.99.1 running: yes Sound Server-3: PipeWire v: 0.3.48 running: yes

Network:
Device-1: Realtek RTL8125 2.5GbE vendor: Gigabyte driver: r8169 v: kernel pcie: speed: 5 GT/s lanes: 1 port: f000 bus-ID: 09:00.0 chip-ID: 10ec:8125 IF: eno1 state: down mac: Device-2: MEDIATEK driver: mt7921e v: kernel pcie: speed: 5 GT/s lanes: 1 port: N/A bus-ID: 0a:00.0 chip-ID: 14c3:0608 IF: wlp10s0 state: up mac:

Bluetooth:
Device-1: MediaTek Wireless_Device type: USB driver: btusb v: 0.8 bus-ID: 1-8:5 chip-ID: 0e8d:0608 Report: hciconfig ID: hci0 rfk-id: 0 state: up address: bt-v: 3.0 lmp-v: 5.2 sub-v: 2202

RAID:
Device-1: bpool type: zfs status: ONLINE level: linear raw: size: 1.88 GiB free: 1.61 GiB zfs-fs: size: 1.75 GiB free: 1.48 GiB Components: Online: N/A Device-2: rpool type: zfs status: ONLINE level: linear raw: size: 920 GiB free: 903 GiB zfs-fs: size: 891.5 GiB free: 873.74 GiB Components: Online: N/A

Drives:
Local Storage: total: raw: 1.43 TiB usable: 2.3 TiB used: 36.7 GiB (1.6%) ID-1: /dev/nvme0n1 vendor: Western Digital model: WD BLACK SN770 1TB size: 931.51 GiB speed: 63.2 Gb/s lanes: 4 serial: temp: 54.9 C ID-2: /dev/nvme1n1 vendor: Intel model: SSDPEKNW512G8 size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 serial: temp: 44.9 C ID-3: /dev/sda type: USB vendor: Generic model: N/A size: 58 GiB serial:

Partition:
ID-1: / size: 890.42 GiB used: 16.68 GiB (1.9%) fs: zfs logical: rpool/ROOT/ubuntu_2yhufy ID-2: /boot size: 1.75 GiB used: 270.8 MiB (15.1%) fs: zfs logical: bpool/BOOT/ubuntu_2yhufy ID-3: /boot/efi size: 512 MiB used: 15.9 MiB (3.1%) fs: vfat dev: /dev/nvme0n1p2 ID-4: /var/log size: 873.75 GiB used: 12.5 MiB (0.0%) fs: zfs logical: rpool/ROOT/ubuntu_2yhufy/var/log

Swap:
ID-1: swap-1 type: partition size: 2 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/dm-1 mapped: cryptoswap

Sensors:
System Temperatures: cpu: 47.0 C mobo: 45.0 C gpu: nouveau temp: 33.0 C Fan Speeds (RPM): N/A gpu: nouveau fan: 993

Repos:
Packages: 2397 apt: 2394 snap: 3 No active apt repos in: /etc/apt/sources.list Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https: //brave-browser-apt-release.s3.brave.com/ stable main Active apt repos in: /etc/apt/sources.list.d/keybase.list 1: deb http: //prerelease.keybase.io/deb stable main Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 1: deb http: //packages.linuxmint.com vera main upstream import backport 2: deb http: //archive.ubuntu.com/ubuntu jammy main restricted universe multiverse 3: deb http: //archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse 4: deb http: //archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse 5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse Active apt repos in: /etc/apt/sources.list.d/protonvpn-stable.list 1: deb [arch="all", signed-by=/usr/share/keyrings/protonvpn-stable-archive-keyring.gpg] https: //repo.protonvpn.com/debian stable main No active apt repos in: /etc/apt/sources.list.d/steam-beta.list Active apt repos in: /etc/apt/sources.list.d/steam-stable.list 1: deb [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https: //repo.steampowered.com/steam/ stable steam 2: deb-src [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https: //repo.steampowered.com/steam/ stable steam

Info:
Processes: 549 Uptime: 3h 23m Memory: 31.25 GiB used: 5.83 GiB (18.7%) Init: systemd v: 249 runlevel: 5 Compilers: gcc: 11.3.0 alt: 11/12 clang: 14.0.0-1ubuntu1 Client: Cinnamon v: 5.6.8 inxi: 3.3.13
Last edited by LockBot on Sat Dec 02, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- Maddie
Locked

Return to “Scripts & Bash”