Get access to virtual appliance (Check_MK virt1) - reset web password and device password

Hello everyone,
we have a virtual machine, based on the Check_MK virt1 in version 1.4.4

The appliance was created and set up by our colleague, who is unfortunately now seriously ill. Unfortunately we have no possibility to ask him for the access data.

We have full access to the hard disks and can also start the virtual machine with a boot CD such as Grml and mount the 3 hard disks contained in the appliance.

Unfortunately we don’t know exactly where and how we can recreate the password hashes so that we can log in again afterwards.

We have already tried the following unsuccessfully with the boot CD Grml:

  • sudo mkdir /media/sda1
  • sudo mkdir /media/sdb1
  • sudo mkdir /media/sdb2
  • mount /dev/sda1 /media/sda1
  • mount /dev/sdb1 /media/sdb1
  • mount /dev/sdb2 /media/sdb2

Try 1 - Reset the root password of partition 1:

  • sudo chroot /media/sda1
  • passwd

Try 2 - Reset site password:

  • cat /media/sdb2/sites/OUR_SITE_NAME/etc/htpasswd
  • /media/sda1/usr/bin/htpasswd -d /media/sdb2/sites/OUR_SITE_NAME/etc/htpasswd cmkadmin

Although both attempts resulted in the password hashes in /media/sda1/etc/shadow and /media/sdb2/sites/OUR_SITE_NAME/etc/htpasswd being changed, but it was still not possible to log in via console (device password) or via the web interface (only password query without user name).

Who can help us to change the passwords correctly or at worst export the configuration of the appliance and import it into a new appliance.

Thanks for your help

Best regards
Falk v. Broen

Hello everyone,

I was able to solve my questions myself in the meantime.

For all those who also need access to your appliance again, the following instructions:

  1. insert Grml Linux Boot-CD into the virtual machine and boot from it
  2. display all partitions
  3. mount partitions, for this purpose in Grml under /media/ create directories for the partitions with mkdir sda1, sdb1, sdb2
  4. mount partitions on the created directories with for example mount /dev/sda1 /media/sda1

Disable device password:
5. change to the config directory of the CheckMK Appliance: cd /media/sdb1/etc/cmd
6. display configuration files: ls
7. display basic configuration: cat cma.conf
8. change the line console_login = True to console_login = False with the text editor vi or vim
9. after restarting the CheckMK Appliance, you can go directly to the configuration without a password prompt and can reset the settings and the device password there. Select options with the space bar.
10. alternatively, enter the host name of the appliance in the address line via the web browser and enter the newly set device password if necessary.

Change site passwords:
To do this, perform steps 1 to 4 in advance.
5. find out which instances (names) of CheckMK have been set up: cd /media/sdb2/sites then enter ls
6. find out which users are installed on a CheckMK instance: cat /media/sdb2/sites/SITE_FOLDER_NAME/etc/htpasswd
7. change the password of this site: /media/sda1/usr/bin/htpasswd -d /media/sdb2/sites/SITE_FOLDER_NAME/etc/htpasswd USERNAME_TO_CHANGE_PASSWORD
8. restart VM without Grml and access the CheckMK site via web browser: http://CHECKMK_HOSTNAME/SITE_FOLDER_NAME/

Best regards
Falk v. Broen