Commit 1a73021
cockpit: add supplementary group memberships so PAM auth completes
After mios.git@569b567 added the static cockpit-* users and fixed the
socket SocketUser/SocketGroup overrides, HTTP 200 came back on the
cockpit login page but POST /cockpit/login still returned 401
"Authentication not available". cockpit-tls journal kept saying:
/run/cockpit/session: couldn't connect: Permission denied
Root cause: the dynamic-user IDs that cockpit's instance units expect
(cockpit-wsinstance-https / cockpit-wsinstance-http /
cockpit-wsinstance-socket / cockpit-ws / cockpit-systemd-service)
were created with NO supplementary group memberships. cockpit-ws
running under cockpit-wsinstance-https tried to connect to
/run/cockpit/session (group cockpit-session-socket, mode 0660) and
got refused because cockpit-wsinstance-https's primary group is its
own 953, not 974/cockpit-session-socket.
Added cross-memberships via `m` directives so every cockpit helper
user has supplementary access to both socket groups:
m cockpit-ws cockpit-wsinstance-socket
m cockpit-systemd-service cockpit-wsinstance-socket
m cockpit-systemd-service cockpit-session-socket
m cockpit-ws cockpit-session-socket
m cockpit-wsinstance-https cockpit-session-socket
m cockpit-wsinstance-https cockpit-wsinstance-socket
m cockpit-wsinstance-http cockpit-session-socket
m cockpit-wsinstance-http cockpit-wsinstance-socket
m cockpit-wsinstance-socket cockpit-session-socket
Verified live (operator's installed VM):
PowerShell from Windows host:
Invoke-WebRequest -Headers @{'X-Authorize'='password'} \
-Credential mios:mios https://localhost:9090/cockpit/login
-> HTTP 200 + Set-Cookie: cockpit=<session-token>...
journal:
pam_unix(cockpit:session): session opened for user mios(uid=992)
systemd-sysusers does not retro-apply `m` directives reliably on a
populated /etc/group, so the install path also runs explicit
`usermod -aG` lines (mios-bootstrap-side fix in a sibling commit) to
materialize the memberships on first overlay run.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 9055dcc commit 1a73021
1 file changed
Lines changed: 29 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
0 commit comments