When booting into recovery mode, filesystem won't be mounted as read-write and therefore when attempting to change the password it won't work. To proceed we'll just have to remount the / as read-write by issuing the following command.
mount -rw -o remount /