unraid / unraid/webgui

SSH keys added via WebGUI user page are ignored by sshd

Open
#2,703 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
253
Forks
106
Avg merge
6d 22h
Merged PRs (30d)
12

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the WebGUI Users > root page and trace how the SSH authorized keys field is saved. Compare that behavior with sshd_config's AuthorizedKeysFile setting and the listed /root/.ssh/authorized_keys, /etc/ssh/root.pubkeys, and /boot/config/ssh/root.pubkeys paths. Done means a key saved through the GUI is available to sshd and persists as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.