I lost my password to a VM running 11.04, but have ssh access via public key authentication.
Is there any way I can reset the password without a reboot? (This is to avoid downtime of services it's running.)
You can if you:
Basically you need to get root access somehow.
If you have access to VM console you have root permissions there (e.g. for XEN:
Theoretically at least, you could make a copy of the VM, mount the drive of the (non-running) copy, dump the password hashes from
But unless your password is really simple, or you know a lot about it and are experienced dumping and cracking password hashes, and also unless the need to avoid downtime is extreme, you should not attempt something like this. (In fact, I mainly bring it up for completeness, so you can see that the reasonable options really have been exhausted.) Instead, if you cannot become root in the VM and you cannot use the VM console, you should just reboot the VM, boot into recovery mode, and reset the password.