Change root password in CLI

This article describes how to change your root passwort on CLI (command line interface).

There are three different scenarios.


 * 1) You have access to OMV and have the current root password
 * 2) You have access to the OMV GUI via the 'admin' user, but have forgotten the root password
 * 3) You do not have any access to OMV anymore and do not know the current admin or root password

Known Root Password
 Login to the OMV using the root user and the current password via SSH or Console enter the following command passwd root  The new password is now active.

Unknown Root Password, but Admin Access to OMV GUI is Available
In this scenario we still can help ourselves with the GUI. The method we use is, that we create a cron job for the root user which then resets the password.   Navigate to System -> Cron Jobs  Press the +Add button  UN-tick the enabled box, so that the cronjob does not run automatically.  put into the command field the following line, replace newpasswd with your password: echo "root:newpasswd" | chpasswd  press okay  select the newly created cron job  Click the run button.  in the opening window click the start button. It will shortly deactivate and activate again.  open ssh or console and login as root with your new password. 

Root and Admin Password Unknown
If you do not know the root password, you need to boot with a Linux live CD like Knoppix or SystemRescueCD  <li> Download a linux boot cd like SystemRescueCD <li> Boot from the SystemRescueCD <li> Enter the following commands: mkdir /omvroot mount /dev/sda1 /omvroot cd /omvroot/etc <li>Edit with your preferred editor (nano/vim) the file /omvroot/etc/shadow vi /omvroot/etc/shadow <li> You will see a line like this (first line) (your encrypted key will be much longer than this) root:dsfDSDF!s:12581:0:99999:7::: <li> Remove everything between the first and second ':' which is in this example 'dsfDSDF!s'. The line should look like this: root::12581:0:99999:7::: <li> Final steps: cd / umount /omvroot reboot <li>Now connect to OMV via ssh or console and login as root. </ol>