feat: personal accounts the way OMV's web UI makes them (NetOrk/netork#1793)
driver / standard (pull_request) Failing after 14s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Failing after 1m13s
driver / test (3.13) (pull_request) Failing after 1m6s
driver / test (3.12) (pull_request) Failing after 1m17s
driver / lowest (pull_request) Failing after 29s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Failing after 2m25s
driver / publish (pull_request) Skipped

napalm-linux adds and locks accounts with shadow-utils and keys in ~/.ssh.
OMV's sshd lets in only root and _ssh, and OMV keeps a user's keys in its
own database, deploying them to /var/lib/openmediavault/ssh/authorized_keys.
So a new account is made by UserMgmt.setUser in _ssh, one made outside OMV
joins _ssh when it is opened, and keys go through setUser. Each call applies
the modules it made dirty (postfix, ssh) and leaves what was pending in the
web UI pending. setUser takes a plain password, netOrk only the hash, so the
hash is set with usermod -p. The lock stays napalm-linux's expiry.

Checked on a fresh OMV 8 (Debian 13) with the real driver over SSH and
sudo -S: a new account logs in with its key and uses sudo, is refused
after locking with OMV's keys emptied, logs in again after reopening; an
account made outside OMV is let in once it joined _ssh; a module left
dirty before stays dirty.
This commit is contained in:
Christian Manivong committed 2026-10-31 23:43:43 +01:00
1 parent 28e4a2a6e2
commit d477fb1a76
4 files changed
+422 -1

No files matched your search

+12
View File
@@ -7,6 +7,18 @@ All notable changes to this driver. The format follows
## [Unreleased]
### Added
- Personal accounts the way OMV's web UI makes them (NetOrk/netork#1793), on top of
napalm-linux's `get_local_accounts()`, `add_local_account()` and `lock_local_account()`.
OMV's sshd lets in only `root` and `_ssh`, and OMV keeps a user's keys in its own
database, deploying them to `/var/lib/openmediavault/ssh/authorized_keys/<user>`. So a
new account is made by `UserMgmt.setUser` in `_ssh`, an account made outside OMV joins
`_ssh` when it is opened, and keys are added and removed through `setUser`. Each call
applies the modules it made dirty (`postfix`, `ssh`) and nothing else: changes left
pending in the web UI stay pending. `setUser` takes a plain password, which netOrk does
not have, so the hash is set with `usermod -p`. Like the web UI, `setUser` gives the
account OMV's primary group `users`. Checked on a fresh OMV 8 (Debian 13) with the real
driver over SSH. Requires the napalm-device-types and napalm-linux releases with
personal accounts.
- `set_hostname()` the way OMV's web UI renames the NAS: `Network.setGeneralSettings`
(an FQDN sets the domain too, a bare name keeps it), then `Config.applyChanges` for the
modules the rename made dirty plus the hostname modules already dirty. Changes left