Skip to content

Add password management CLI commands #232

Description

@melvincarvalho

Summary

JSS needs CLI commands for managing user passwords. Currently there's no way to reset a password without manually editing account JSON files and hashing with bcrypt.

Proposed commands

jss passwd <username>                  # Interactive password reset
jss passwd <username> --password <pw>  # Non-interactive password reset
jss passwd <username> --generate       # Generate and print a random password

Context

Currently the only way to reset a password is:

  1. Find the account UUID in _username_index.json
  2. Hash the new password with bcryptjs
  3. Manually edit the account JSON file

This should be a one-liner for server admins.

Implementation

  • Add passwd subcommand to bin/jss.js
  • Load account by username from _username_index.json
  • Hash new password with bcryptjs
  • Write updated account file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions