Skip to content

SSH keys added via WebGUI user page are ignored by sshd #2703

Description

@mylex78

Unraid version: 7.3.2

Description

SSH public keys added through the WebGUI (Users > root > SSH authorized keys) are written to
/root/.ssh/authorized_keys, but sshd_config is configured with:

AuthorizedKeysFile /etc/ssh/%u.pubkeys

This means sshd never reads the keys saved by the GUI. SSH key authentication silently fails and falls back to
password, with no indication to the user that anything is wrong.

Steps to reproduce

  1. Go to Users > root in the WebGUI
  2. Paste an SSH public key into the "SSH authorized keys" field
  3. Click Save
  4. Try to SSH in using that key — authentication fails
  5. Compare the files:
    - GUI writes to: /root/.ssh/authorized_keys
    - sshd reads from: /etc/ssh/root.pubkeys (per sshd_config)

Workaround

Manually add the key to both /etc/ssh/root.pubkeys and /boot/config/ssh/root.pubkeys.

Expected behavior

The WebGUI should write SSH keys to /etc/ssh/root.pubkeys and /boot/config/ssh/root.pubkeys to match the
AuthorizedKeysFile setting in sshd_config.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions