SSH keys added via WebGUI user page are ignored by sshd
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
- Go to Users > root in the WebGUI
- Paste an SSH public key into the "SSH authorized keys" field
- Click Save
- Try to SSH in using that key — authentication fails
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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