Skip to content

Instantly share code, notes, and snippets.

@lazyfrosch
Last active May 2, 2023 21:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lazyfrosch/1ed1b9d574ea39995108fc4df57284c6 to your computer and use it in GitHub Desktop.
Save lazyfrosch/1ed1b9d574ea39995108fc4df57284c6 to your computer and use it in GitHub Desktop.
How to create a new admin or reset password for NagVis

NagVis Create Admin

For salt see: https://github.com/NagVis/nagvis/blob/51051b851b1b9981b51db81818700015735900a5/share/server/core/defines/global.php#L182

NAGVIS_SALT=42371010993337eeebe65383f731080da0f9f035
echo -n "${NAGVIS_SALT}mypassword" | sha1sum -
sqlite3 auth.db

To reset a password do this:

UPDATE users SET password  '<generated hash>' WHERE name = 'username',

To create a new user, insert a user with its password hash and assign a role.

INSERT INTO users (name, password) VALUES ('myadmin', '<generated hash>');
SELECT * FROM users where name = 'myadmin';

INSERT INTO users2roles VALUES (15, 1); -- userId and roleId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment