Gain root in the docker version of checkmk to be able to write to /var/lib/check_mk_agent/spool & /usr/lib/check_mk_agent/plugins/foobar.sh &

Hi,

TLDR: I fired up a docker cee to do some test and want to become root.

I added localhost into the monitoring.
Now I want do create/edit some files in /var/lib/check_mk_agent/spool
and /usr/lib/check_mk_agent/plugins/

But this is only possible as root.

$ docker container exec -it -u cmk monitoring /bin/bash

OMD[cmk]:~$ touch /usr/lib/check_mk_agent/plugins/foobar.sh
touch: cannot touch '/usr/lib/check_mk_agent/plugins/foobar.sh': Permission denied

What is the root pw of the checkmk Container ?

I can’t see any hint here, it isn’t possible to pass the root password as ENV

Perhaps the container is based on debian and there is a default root password for the
base image ?

It’s easier than I tought:

docker container exec -it -u root monitoring /bin/bash

no su - inside the container, just -u root

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.