How to reset the knimeadmin password from the CLI

Hi Andreas,

It’s possible to manually reset the database. Under Linux you can run a script something like. Note that you’ll need to edit the script to reflect the correct locations (and the new password) in your case:

#!/bin/bash

set -x

# Location of this script.
location="/opt"

# tomcat home directory
tomcat_home="/opt/apache-tomee-plus-7.0.3"

# db parameters
dburl="jdbc:h2:$tomcat_home/conf/userconf"

# construct db query
newpassword=enteryournewpasswordhere
newpassword=$($tomcat_home/bin/digest.sh -a sha-256 $newpassword)
newpassword=${newpassword#*:}

echo "update users set user_pass='$newpassword' where user_name='knimeadmin';" > $location/dbscript

chown knime:knime $location/dbscript

# manipulate db
java -cp $tomcat_home/lib/h2*.jar org.h2.tools.RunScript -url $dburl -script $location/dbscript

# delete script file
rm dbscript

exit 0
6 Likes