Reset the Core admin password

If you have lost the Linknesis Core admin password, you can reset it directly in the MongoDB users collection.

Before you start

  • You need root or sudo access to the Core host.
  • You need the MongoDB admin password. It was printed in the installer "SAVE THIS INFORMATION" report and is stored in /opt/linknesis/.env as MONGO_ROOT_PASSWORD.
  • The Core container must be restarted after the change so it reloads the new hash.

1. Set the new password

Run this on the Core host. First, generate a value the Core will accept for your new password:

python3 - <<'PY'
import hashlib, os, binascii, json

password = "your-new-password"        # change this
salt     = os.urandom(16)
digest   = hashlib.pbkdf2_hmac('sha256', password.encode('utf-8'), salt, 10000)

print(json.dumps({
    "password_hash": binascii.hexlify(digest).decode('ascii'),
    "password_salt": binascii.hexlify(salt).decode('ascii')
}, indent=2))
PY

Then save it to the admin user, replacing HASH and SALT with the values just printed:

docker exec -it linknesis-db mongosh \
  -u admin -p '<MONGO_ROOT_PASSWORD>' \
  --authenticationDatabase admin linknesis \
  --eval 'db.users.updateOne(
    { username: "admin" },
    { $set: { password_hash: "HASH", password_salt: "SALT" } },
    { upsert: true }
  )'

If your MongoDB container is named differently, replace linknesis-db with the actual container name.

2. Restart the Core

The Core reads the admin password into memory at startup, so you must restart it for the change to take effect:

docker restart linknesis-core

3. Verify

Open the Core Web GUI and log in with username admin and the new password you chose in step 1.

© Linknesis. Documentation for the Linknesis network monitoring platform.