On Mon, Jan 12, 2015 at 03:58:14PM +0000, Daniel P. Berrange wrote: > Add a new 'guest-set-admin-password' command for changing the > root/administrator password. This command is needed to allow > OpenStack to support its API for changing the admin password > on a running guest. > > Accepts either the raw password string: > > $ virsh -c qemu:///system qemu-agent-command f21x86_64 \ > '{ "execute": "guest-set-admin-password", "arguments": > { "crypted": false, "password": "12345678" } }' > {"return":{}} > > Or a pre-encrypted string (recommended) > > $ virsh -c qemu:///system qemu-agent-command f21x86_64 \ > '{ "execute": "guest-set-admin-password", "arguments": > { "crypted": true, "password": > "$6$T9O/j/aGPrE...snip....rQoRN4F0.GG0MPjNUNyml." } }'
Does it have to be a QMP command? Wouldn't the recently (re-)submitted guest-exec allow to do the same, by running "chpasswd" in the guest and piping the username:password into its stdin? Besides I think it makes sense to (optionally) pass the username, to allow to change the password for arbitrary users. This would make the functionality useful for systems where root password plays no role as root logins are disallowed, and the only access to root shell is via sudo from a user belonging to a particular group (IIRC Ubuntu is usually set up like that). > NB windows support is desirable, but not implemented in this > patch. Yes Windows may have an issue with username here too, because the admin user can be any user (and even "Administrator" can be localized). Roman.