userdel versions have this option:
-R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
In other words, instead of editing
/etc/passwd and friends,
For example, you might boot a live CD, mount the hard drive as
and then use
-R /mnt to edit its users.