To secure privileged EXEC access, use the enable secret password command. An older, less secure variation of this command is the enable password password command. Although either of these commands can be used to establish authentication before access to privileged EXEC (enable) mode is permitted, it is recommended to use the enable secret command. The enable secret command provides greater security because the password is encrypted.
Example command to set passwords:
Switch(config)# enable secret class
The example in the figure illustrates how a password is not requested when first using the enable command. Next the enable secret class command is configured and now privileged EXEC access is secured. Notice that for security reasons, the password is not displayed when it is being entered.