Found it. The trick is to type just passwd, hit enter and wait for the prompt before entering the new password!