Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a helper script for generating password entries for users and agents. #8135

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

jameinel
Copy link
Member

Description of change

If you ever need to reset a user or agent password during maintenance, it can be hard to figure out exactly what needs to go in the various password hash fields.
This is a helper that uses our existing utils package to generate a new random user password and machine password.

QA steps

$ juju bootstrap
$ juju deploy foo
$ juju models --uuid
$ generate-password UUID foo/0
# Should give you a database record to update and a value to update in agent.conf
# If you do both, the agent unit-foo-0 should still be able to connect to the database.
$ generate-password --user admin
# should generate similar mongo updates and values for ~/.local/share/accounts.yaml.

Documentation changes

I don't think we document unofficial scripts.

Bug reference

None

@jameinel
Copy link
Member Author

generate-password

@jameinel
Copy link
Member Author

Generate Password

Copy link
Contributor

@ExternalReality ExternalReality left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried the QA steps which I can confirmed have worked as described. LGTM.

$> generate-password UUID ubuntu/0
>>> oldpassword: QBvg0nNV6YYr0lqnP12O6yyf
db.units.update({"_id": "UUID:ubuntu/0"}, {$set: {"passwordhash": "+qCF5wqoiYPyK+0nX6KK0ca8"}})
$> generate-password --user admin
>>> Password line for ~/.local/share/juju/accounts.yaml
  password: LYwlL7df9ELxraeQVY3NplHN
db.users.update({"_id": "admin"}, {"$set": {"passwordsalt": "yTFMbtKsElRchF9S", "passwordhash": "kVEv+ZvFvNVqZBYODnzoEDne"}})

@jameinel
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit ca96890 into juju:develop Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants