How can I give a user the permissions to run "adduser" and "deluser"?

693 Views Asked by At

How can I give a user the necessary permissions so that he can run "adduser" and "deluser" - but no other privileges?

FROM alpine:3.15.4

RUN addgroup -S tgroup -g 12345 && adduser -S tester -G tgroup -u 23456
RUN chown tester:tgroup /home &&  chmod 0700 /home
RUN adduser tester wheel

USER tester
WORKDIR /home/tester

# just for testing purpose
RUN addgroup -S ssh && adduser -S newuser -G ssh 

Do other packages have to be installed for this?

Currently I get the error message:

---> Running in 31db4ea578ed
addgroup: permission denied (are you root?)
0

There are 0 best solutions below