We have seen how to set passwords on cisco switches or routers here. Of course setting passwords does add to the security of the device but there is small problem. The password is stored in plain text. Anyone who gets access to the switch can easily see all the passwords by typing command show running-config or show startup-config.
Encrypting passwords can further enhance the security of the device. In this howto we are going to see how to encrypt passwords on a switch or router using cisco ios. Privileged password can be encrypted by using the command enable secret instead of enable password. This command should be set from privileged global configuration mode.
Lets see what can we see when we use the command show running-config.
We can see that the password we set has been encrypted. but what about other passwords. The console, auxiliary and vty lines passwords cannot be encrypted even if we use enable secret command. To encrypt those passwords, we have to use another command service password-encryption as shown below.
This command will encrypt all the passwords stored in plain text on the device.