Resetting a Password Using Chroot

chroot has quite a unique history. The chroot system call was the first major step towards process-level virtualization, i.e. providing an isolated environment for a process (though only at the file system level). Virtualization is an enabler for cloud computing. You can read more about chroot here. Let’s look at a real-life scenario where chroot helped my team.

Problem

During my post-graduate development, my team faced a situation where we had to reset a password for a system as the old password was not known. This system was being used for virtualization-related research cluster. This system was installed with a particular virtualization-patched kernel and many other utilities and their configs. To recreate the same environment freshly was hard and error-prone.