mimimi
(Y0d0g)
September 10, 2021, 10:12am
1
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
ARG IMAGE_CMK_BASE
# hadolint ignore=DL3006
FROM ${IMAGE_CMK_BASE}
LABEL maintainer="feedback@checkmk.com"
# Pure build time variable declarations (docker build --build-arg KEY=val)
ARG CMK_VERSION="2.1.0i1"
# Choose one of: raw, enterprise, managed
ARG CMK_EDITION="raw"
ARG CMK_DL_URL="https://download.checkmk.com/checkmk"
# The following variables can be set during container init (docker run -e KEY=val)
ARG CMK_SITE_ID
ENV CMK_SITE_ID="cmk"
# Set this to "on" to enable livestatus via network
ARG CMK_LIVESTATUS_TCP
ENV CMK_LIVESTATUS_TCP=""
# A random password will be generated in case you don't set this
ARG CMK_PASSWORD
This file has been truncated. show original
Perhaps the container is based on debian and there is a default root password for the
base image ?
mimimi
(Y0d0g)
September 10, 2021, 10:17am
2
It’s easier than I tought:
docker container exec -it -u root monitoring /bin/bash
no su - inside the container, just -u root
system
(system)
Closed
September 10, 2022, 10:18am
3
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.