Security - Best Practices for Repurposing Network Devices

When repurposing network devices (selling, moving from one department to another, replacing older equipment etc), it is crucial to erase all configurations to prevent potential security risks. Neglecting to clear configurations can expose sensitive information such as passwords, IP addresses, and other confidential data, which can be exploited by malicious users.

If you do not do this, even if a user doesn't know the password to enter the configuration mode of the device, they can perform a password recovery process, thus gaining access to all information contained within the configuration.

https://networklessons.com/cisco/ccna-200-301//cisco-ios-router-password-recovery