--- /dev/null
+const bcrypt = require('bcrypt');
+
+/* The sigint:true property allows the user to abort the entire program
+ * with Control-C (rather than having to abort through each prompt).
+ */
+const prompt = require('prompt-sync')({
+ sigint: true
+});
+
+const username = prompt("Username: ");
+
+while (true) {
+ /* Use "echo:'*'" to avoid displaying the password while typing. */
+ var password = prompt("New password: ", {echo: '*'});
+ const password_again = prompt("Re-type new password: ", {echo: '*'});
+
+ if (password === password_again)
+ break;
+
+ console.log("Passwords do not match. Try again.");
+}
+
+const hash = bcrypt.hashSync(password, 12);
+
+console.log(`Add the following block to the 'users' object in lmno-config.js:
+
+ "${username}": {
+ "password_hash_bcrypt": "${hash}",
+ "role": "user"
+ }
+`);