Reset admin password

Enonic version: 6.5.4
OS: Windows Server 2016

Hi,

I recently took over a project that was already developed and running for a while. They now want to change somethings, but they do not have an admin account.

I have access to the host machine and was wondering if there is anyway for me to reset this password?

Thanks,
Berzi

Hi, you can set the su-password in system.properties: https://developer.enonic.com/docs/xp/stable/deployment/config#system_properties

Best practice is to just store the pwd hash in the file, use e.g a script like this to get an encrypted pwd (linux, with pwdgen):

#/bin/bash

if ! [ -x "$(command -v pwgen)" ]; then
  echo '[pwgen] not found in path, please install'
  exit 1
fi

echo "# Generating password....."
suPasswdClear=$(pwgen 14 1)
hashedPwd=$(echo -n ${suPasswdClear} | sha512sum | awk '{print $1}')
suPasswd=$(echo "{sha512}${hashedPwd}")

echo "suPasswdClear=\"$suPasswdClear\""
echo "suPasswd=\"$suPasswd\""
1 Like

Thank you very much Runar! I have now successfully reset the su password.

I have also added feature request with our ops team to implement a script like this.