A little bit like this: https://help.ubuntu.com/community/LiveCdRecovery
You boot Linux from the Live CD (not using it as a replacement boot loader, but booting into the Live CD installation).
Then mount the partition containing /
of your hard disk installation, similar to the tutorial.
Stop before doing chroot
! Just cd
the the directory where you mounted it, enter etc
, cp passwd passwd.backup
for good measure (in case your cat jumps on the keyboard one moment later) and vi passwd
.