wido opened a new pull request, #14080:
URL: https://github.com/apache/cloudstack/pull/14080
### Description
This PR adds a `set-password` command to `cloud-guest-tool` (the KVM
host-side helper that talks to Instances through the Qemu Guest Agent via
libvirt).
It resets the password of a user inside a running Instance using QGA's
`guest-set-user-password` command — no password server reachable from the guest
and no reset script inside the template required, only a running
qemu-guest-agent.
Usage:
```
# read the new password from stdin (preferred: keeps it out of the process
list;
# an interactive terminal gets a no-echo prompt instead)
echo 'S3cret!' | cloud-guest-tool i-2-42-VM --command set-password
# other user, password as argument
cloud-guest-tool i-2-42-VM --command set-password --username admin
--password 'S3cret!'
# pre-hashed crypt(3) value, applied verbatim by QGA
cloud-guest-tool i-2-42-VM --command set-password --crypted --password
'$6$...'
```
The password is base64-encoded as the QGA protocol requires.
`agent_command()` gained an optional `arguments` parameter for this — the first
QGA command the tool sends with a payload; the existing `info`, `ping` and
`fstrim` commands are unchanged.
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [x] Minor
### How Has This Been Tested?
The QGA request shape and all three input paths (stdin pipe, `--password`
argument with `--crypted`, and the empty-input error) were exercised end-to-end
with stubbed `libvirt`/`libvirt_qemu` modules; the generated request is e.g.
`{"execute": "guest-set-user-password", "arguments": {"username": "admin",
"password": "TXlTdGRpblBhc3MxMjM=", "crypted": false}}` and the base64
round-trips to the input. Not yet run against a live guest.
https://claude.ai/code/session_01LkswKyuC2a58YCHFTEPnay
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]