Skip to content

Add support for U2F authentication#3638

Merged
svartkanin merged 6 commits intoarchlinux:masterfrom
svartkanin:fix-1286
Jun 30, 2025
Merged

Add support for U2F authentication#3638
svartkanin merged 6 commits intoarchlinux:masterfrom
svartkanin:fix-1286

Conversation

@svartkanin
Copy link
Copy Markdown
Collaborator

This PR adds support for U2F device login #1286.

  • Create a new Authentication menu entry
  • The U2F login setup entry is only displayed IF a U2F device was found
  • The U2F device is configured via the /etc/pam.d/system-login and optionally the /etc/pam.d/sudo files
    • The former should be included by other files such as kde, sddm, gdm-password and thereby apply

Future PR

  • Move the Root password and User accounts into the Authentication menu

@svartkanin svartkanin requested a review from Torxed as a code owner June 29, 2025 08:56
@svartkanin svartkanin changed the title Fix 1286 Add support for U2F authentication Jun 29, 2025
Copy link
Copy Markdown
Member

@Torxed Torxed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome addition! Just a small pylint thing then we can merge!

@svartkanin svartkanin merged commit 55a3837 into archlinux:master Jun 30, 2025
9 checks passed
@svartkanin svartkanin deleted the fix-1286 branch June 30, 2025 11:51
parent_dev_path = device_handler.get_parent_device_path(boot_partition.safe_dev_path)

cmd_template = (
cmd_template = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed? What did this have to do with this pull request?

This was a tuple because it avoids unnecessary mutability, has the slight benefit of using less memory, and communicates that it is a static sequence meant to be reused. It is being formatted and expanded into lists later anyway.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out, it was accidentally committed, reverted #3648

@codefiles
Copy link
Copy Markdown
Contributor

With the changes in the last commit, this should have been reviewed and approved again before merging.

@CelestifyX
Copy link
Copy Markdown

CelestifyX commented Jun 30, 2025

Traceback (most recent call last):
  File "/home/celestifyx/Desktop/archinstall/archinstall/__init__.py", line 104, in run_as_a_module
    rc = main()
  File "/home/celestifyx/Desktop/archinstall/archinstall/__init__.py", line 94, in main
    importlib.import_module(mod_name)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/celestifyx/Desktop/archinstall/archinstall/scripts/guided.py", line 212, in <module>
    guided()
    ~~~~~~^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/scripts/guided.py", line 186, in guided
    ask_user_questions()
    ~~~~~~~~~~~~~~~~~~^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/scripts/guided.py", line 47, in ask_user_questions
    global_menu.run(additional_title=title_text)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/lib/menu/abstract_menu.py", line 113, in run
    ).run()
      ~~~^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/curses_menu.py", line 757, in run
    result = Tui.run(self)
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/curses_menu.py", line 1349, in run
    return Tui.t()._main_loop(component)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/curses_menu.py", line 1357, in _main_loop
    return component.kickoff(self._screen)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/curses_menu.py", line 772, in kickoff
    ret = self._process_input_key(key)
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/curses_menu.py", line 1187, in _process_input_key
    item.value = item.action(item.value)
                 ~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/lib/global_menu.py", line 270, in _select_authentication
    auth_config = AuthenticationMenu(preset).run()
                  ~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/lib/authentication/authentication_menu.py", line 21, in __init__
    self._item_group = MenuItemGroup(menu_optioons, checkmarks=True)
                       ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/menu_item.py", line 97, in __init__
    self.focus_first()
    ~~~~~~~~~~~~~~~~^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/menu_item.py", line 278, in focus_first
    if first_item and not self._is_selectable(first_item):
                          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/menu_item.py", line 349, in _is_selectable
    return self.is_enabled(item)
           ~~~~~~~~~~~~~~~^^^^^^
  File "/home/celestifyx/Desktop/archinstall/archinstall/tui/menu_item.py", line 361, in is_enabled
    return dep()
  File "/home/celestifyx/Desktop/archinstall/archinstall/lib/authentication/authentication_menu.py", line 47, in _depends_on_u2f
    devices = Fido2.get_fido2_devices()
  File "/home/celestifyx/Desktop/archinstall/archinstall/lib/disk/fido.py", line 40, in get_fido2_devices
    path, details = line.replace(',', '').split(':', maxsplit=1)
    ^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

@svartkanin fix

@svartkanin
Copy link
Copy Markdown
Collaborator Author

@CelestifyX could you share your log

@svartkanin
Copy link
Copy Markdown
Collaborator Author

@CelestifyX this should fix it #3648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants