how can I reset the knimeadmin password from the CLI. I cannot use the webinterface because I don’t know the current password. However, I have CLI access to the machine the server runs on.
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
thanks a lot for this code snippet!! It worked perfectly.
One note for other people who run into this situation: before running Jon’s script, you need to stop KNIME server as the database can only be used from one application at a time.