[RFE] juju change-user-password non interactively

Bug #1890499 reported by Felipe Reyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

juju change-user-password can't be used in script without falling back into something like 'expect'. It would be nice if juju could read the password from the stdin.

----
#!/bin/bash
JUJU_USER=$1
JUJU_PASSWORD=$(pwgen 12 1)
echo $JUJU_PASSWORD | juju change-user-password $JUJU_USER
echo "This is your password: $JUJU_PASSWORD" | mutt -s "New password for user $JUJU_USER" ${JUJU_USER}@example.com -a /tmp/XDefd.png
----

[workaround]

Expect script:

```
#!/usr/bin/expect

set timeout 20
set juju_user [lindex $argv 0]
set juju_password [lindex $argv 1]

spawn juju change-user-password $juju_user

expect "new password:" { send "$juju_password\r" }
expect "type new password again:" { send "$juju_password\r" };

interact
```

Felipe Reyes (freyes)
tags: added: seg
Revision history for this message
Pen Gale (pengale) wrote :

Agreed that this would be nicer if more easily scriptable. Adding to the wishlist, as there is a documented workaround. (Thank you for documenting it!)

Changed in juju:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Wishlist → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.