Password policies and admin password reset

Configure password policy settings and reset the administrator password from the command line

Cloud Management Platform (CMP) enforces password requirements, history, and expiration through settings you configure in customer_settings.py.

Password policy settings

Configure these settings in customer_settings.py:

  • PASSWORD_HISTSIZE: The number of previous passwords a user cannot reuse. The default is 10.
  • AUTH_PASSWORD_VALIDATORS: Password requirements such as length and complexity. By default, Cloud Management Platform requires at least 9 characters and a mix of character types. See the Django password validation documentation.
  • PASSWORD_EXPIRATION_HOURS: The number of hours after which a password expires, and the user must set a new one. The default is 0, which disables expiration.
  • PASSWORD_RESET_TIMEOUT: How long, in days, a password reset token stays valid. The default is 86400.
  • EMAIL_VERIFICATION_TIMEOUT_DAYS: The number of days a user has to use an email verification link before it expires. The default is 1.

Reset the administrator password

If you are locked out or need to reset an administrator’s password, use Django’s built-in changepassword command. SSH into your CMP instance and run:

sudo su -
/opt/cloudbolt/manage.py changepassword <username>

Replace <username> with the administrator’s username; you are prompted to enter and confirm the new password. If you omit the username, changepassword targets your current shell user (for example, root), which is not a CMP account and returns a “user does not exist” error.

Reset from Shell Plus

Alternatively, reset a password from Shell Plus. SSH into your instance, become the root user, and start Shell Plus:

sudo su -
/opt/cloudbolt/manage.py shell_plus

Then run, replacing the username and password:

user = User.objects.get(username='<username>')
user.set_password('your_new_password')
user.save()
exit

The new password is the value you pass to set_password.