Drew Webber (mcdruid) is a UK Drupal developer, PHP programmer and linux sysadmin. This is his website.
If you find yourself stuck trying to login to an lxc container because you've forgotten the password, here's a simple fix.
With the container stopped, on the host machine (assuming it's ubuntu - other linux flavours may vary slightly), navigate as root to:
Then edit the shadow file (perhaps make a backup first), and remove the hash which corresponds to the user's password, leaving the separating colons in place e.g.: