How to get different UID using Dynamic Users with socket activation?
1
vote
0
answers
245
views
I'm following the [Dynamic Users with systemd](https://0pointer.net/blog/dynamic-users-with-systemd.html) post and creating the
waldo.socket
and waldo.service
.
Here is my waldo.socket
.
[Socket]
ListenStream=2048
Accept=yes
And the corresponding waldo@.service
[Service]
ExecStart=-sleep 300
DynamicUser=yes
It works nicely, but I discovered that all sleep 300
are launched with the same UID.
$ ps fax -o uid,pid,cmd | grep sleep
61647 87279 sleep 300
61647 87282 sleep 300
61647 87285 sleep 300
I'd like to have each instance of the service using a distinct UID, as is implied in that article
> By combining dynamic user IDs with socket activation you may easily implement a system where each incoming connection is served by a process instance running as a different, fresh, newly allocated UID within its own sandbox.
**What am I doing wrong ?**
Asked by Steve Schnepp
(111 rep)
Jun 2, 2023, 01:44 PM