Controlling Switch Access With Passwords And Privilege Levels

Transcription

Controlling Switch Access with Passwords andPrivilege Levels Finding Feature Information, page 1 Restrictions for Controlling Switch Access with Passwords and Privileges, page 1 Information About Passwords and Privilege Levels, page 2 How to Control Switch Access with Passwords and Privilege Levels, page 4 Monitoring Switch Access, page 17 Configuration Examples for Setting Passwords and Privilege Levels, page 17 Additional References, page 18Finding Feature InformationYour software release may not support all the features documented in this module. For the latest caveats andfeature information, see Bug Search Tool and the release notes for your platform and software release. Tofind information about the features documented in this module, and to see a list of the releases in which eachfeature is supported, see the feature information table at the end of this module.Use Cisco Feature Navigator to find information about platform support and Cisco software image support.To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is notrequired.Restrictions for Controlling Switch Access with Passwordsand PrivilegesThe following are the restrictions for controlling switch access with passwords and privileges: Disabling password recovery will not work if you have set the switch to boot up manually by using theboot manual global configuration command. This command produces the boot loader prompt (switch:)after the switch is power cycled.Security Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)OL-30243-011

Controlling Switch Access with Passwords and Privilege LevelsInformation About Passwords and Privilege LevelsRelated TopicsDisabling Password Recovery, on page 8Password Recovery, on page 3Information About Passwords and Privilege LevelsDefault Password and Privilege Level ConfigurationA simple way of providing terminal access control in your network is to use passwords and assign privilegelevels. Password protection restricts access to a network or network device. Privilege levels define whatcommands users can enter after they have logged into a network device.This table shows the default password and privilege level configuration.Table 1: Default Password and Privilege LevelsFeatureDefault SettingEnable password and privilege levelNo password is defined. The default is level 15(privileged EXEC level). The password is notencrypted in the configuration file.Enable secret password and privilege levelNo password is defined. The default is level 15(privileged EXEC level). The password is encryptedbefore it is written to the configuration file.Line passwordNo password is defined.Additional Password SecurityTo provide an additional layer of security, particularly for passwords that cross the network or that are storedon a Trivial File Transfer Protocol (TFTP) server, you can use either the enable password or enable secretglobal configuration commands. Both commands accomplish the same thing; that is, you can establish anencrypted password that users must enter to access privileged EXEC mode (the default) or any privilege levelyou specify.We recommend that you use the enable secret command because it uses an improved encryption algorithm.If you configure the enable secret command, it takes precedence over the enable password command; thetwo commands cannot be in effect simultaneously.If you enable password encryption, it applies to all passwords including username passwords, authenticationkey passwords, the privileged command password, and console and virtual terminal line passwords.Related TopicsProtecting Enable and Enable Secret Passwords with Encryption, on page 6Example: Protecting Enable and Enable Secret Passwords with Encryption, on page 17Security Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)2OL-30243-01

Controlling Switch Access with Passwords and Privilege LevelsPassword RecoveryPassword RecoveryBy default, any end user with physical access to the switch can recover from a lost password by interruptingthe boot process while the switch is powering on and then by entering a new password.The password-recovery disable feature protects access to the switch password by disabling part of thisfunctionality. When this feature is enabled, the end user can interrupt the boot process only by agreeing to setthe system back to the default configuration. With password recovery disabled, you can still interrupt the bootprocess and change the password, but the configuration file (config.text) and the VLAN database file (vlan.dat)are deleted.If you disable password recovery, we recommend that you keep a backup copy of the configuration file on asecure server in case the end user interrupts the boot process and sets the system back to default values. Donot keep a backup copy of the configuration file on the switch. If the switch is operating in VTP transparentmode, we recommend that you also keep a backup copy of the VLAN database file on a secure server. Whenthe switch is returned to the default system configuration, you can download the saved files to the switch byusing the Xmodem protocol.To re-enable password recovery, use the service password-recovery global configuration command.Related TopicsDisabling Password Recovery, on page 8Restrictions for Controlling Switch Access with Passwords and Privileges, on page 1Terminal Line Telnet ConfigurationWhen you power-up your switch for the first time, an automatic setup program runs to assign IP informationand to create a default configuration for continued use. The setup program also prompts you to configure yourswitch for Telnet access through a password. If you did not configure this password during the setup program,you can configure it when you set a Telnet password for a terminal line.Related TopicsSetting a Telnet Password for a Terminal Line, on page 9Example: Setting a Telnet Password for a Terminal Line, on page 18Username and Password PairsYou can configure username and password pairs, which are locally stored on the switch. These pairs areassigned to lines or ports and authenticate each user before that user can access the switch. If you have definedprivilege levels, you can also assign a specific privilege level (with associated rights and privileges) to eachusername and password pair.Related TopicsConfiguring Username and Password Pairs, on page 11Security Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)OL-30243-013

Controlling Switch Access with Passwords and Privilege LevelsPrivilege LevelsPrivilege LevelsCisco devices use privilege levels to provide password security for different levels of switch operation. Bydefault, the Cisco IOS software operates in two modes (privilege levels) of password security: user EXEC(Level 1) and privileged EXEC (Level 15). You can configure up to 16 hierarchical levels of commands foreach mode. By configuring multiple passwords, you can allow different sets of users to have access to specifiedcommands.Privilege Levels on LinesUsers can override the privilege level you set using the privilege level line configuration command by loggingin to the line and enabling a different privilege level. They can lower the privilege level by using the disablecommand. If users know the password to a higher privilege level, they can use that password to enable thehigher privilege level. You might specify a high level or privilege level for your console line to restrict lineusage.For example, if you want many users to have access to the clear line command, you can assign it level 2 securityand distribute the level 2 password fairly widely. But if you want more restricted access to the configurecommand, you can assign it level 3 security and distribute that password to a more restricted group of users.Command Privilege LevelsWhen you set a command to a privilege level, all commands whose syntax is a subset of that command arealso set to that level. For example, if you set the show ip traffic command to level 15, the show commandsand show ip commands are automatically set to privilege level 15 unless you set them individually to differentlevels.Related TopicsSetting the Privilege Level for a Command, on page 13Example: Setting the Privilege Level for a Command, on page 18Changing the Default Privilege Level for Lines, on page 15Logging into and Exiting a Privilege Level, on page 16How to Control Switch Access with Passwords and PrivilegeLevelsSetting or Changing a Static Enable PasswordThe enable password controls access to the privileged EXEC mode. Follow these steps to set or change astatic enable password:Security Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)4OL-30243-01

Controlling Switch Access with Passwords and Privilege LevelsSetting or Changing a Static Enable PasswordSUMMARY STEPS1. enable2. configure terminal3. enable password password4. end5. show running-config6. copy running-config startup-configDETAILED STEPSStep 1Command or ActionPurposeenableEnables privileged EXEC mode. Enter your password if prompted.Example:Switch enableStep 2Enters the global configuration mode.configure terminalExample:Switch# configure terminalStep 3enable password passwordDefines a new password or changes an existing password for access toprivileged EXEC mode.Example:By default, no password is defined.Switch(config)# enable passwordsecret321For password, specify a string from 1 to 25 alphanumeric characters. Thestring cannot start with a number, is case sensitive, and allows spaces butignores leading spaces. It can contain the question mark (?) character ifyou precede the question mark with the key combination Crtl-v whenyou create the password; for example, to create the password abc?123,do this:1 Enter abc.2 Enter Crtl-v.3 Enter ?123.When the system prompts you to enter the enable password, you neednot precede the question mark with the Ctrl-v; you can simply enterabc?123 at the password prompt.Security Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)OL-30243-015

Controlling Switch Access with Passwords and Privilege LevelsProtecting Enable and Enable Secret Passwords with EncryptionStep 4Command or ActionPurposeendReturns to privileged EXEC mode.Example:Switch(config)# endStep 5show running-configVerifies your entries.Example:Switch# show running-configStep 6copy running-config startup-config(Optional) Saves your entries in the configuration file.Example:Switch# copy running-configstartup-configRelated TopicsExample: Setting or Changing a Static Enable Password, on page 17Protecting Enable and Enable Secret Passwords with EncryptionFollow these steps to establish an encrypted password that users must enter to access privileged EXEC mode(the default) or any privilege level you specify:SUMMARY STEPS1. enable2. configure terminal3. Use one of the following: enable password [level level]{password encryption-type encrypted-password} enable secret [level level]{password encryption-type encrypted-password}4. service password-encryption5. end6. show running-config7. copy running-config startup-configSecurity Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)6OL-30243-01

Controlling Switch Access with Passwords and Privilege LevelsProtecting Enable and Enable Secret Passwords with EncryptionDETAILED STEPSStep 1Command or ActionPurposeenableEnables privileged EXEC mode. Enter your password if prompted.Example:Switch enableStep 2Enters the global configuration mode.configure terminalExample:Switch# configure terminalStep 3 Defines a new password or changes an existing password foraccess to privileged EXEC mode.Use one of the following: enable password [level level]{password encryption-typeencrypted-password} Defines a secret password, which is saved using a nonreversibleencryption method. (Optional) For level, the range is from 0 to 15. Level 1 isnormal user EXEC mode privileges. The default level is 15(privileged EXEC mode privileges). enable secret [level level]{password encryption-typeencrypted-password} For password, specify a string from 1 to 25 alphanumericcharacters. The string cannot start with a number, is casesensitive, and allows spaces but ignores leading spaces. Bydefault, no password is defined.Example:Switch(config)# enable passwordexample102orSwitch(config)# enable secret level 1password secret123sample (Optional) For encryption-type, only type 5, a Ciscoproprietary encryption algorithm, is available. If you specifyan encryption type, you must provide an encryptedpassword—an encrypted password that you copy fromanother switch configuration.NoteStep 4If you specify an encryption type and then enter a cleartext password, you can not re-enter privileged EXECmode. You cannot recover a lost encrypted password byany method.service password-encryption(Optional) Encrypts the password when the password is defined orwhen the configuration is written.Example:Encryption prevents the password from being readable in theconfiguration file.Switch(config)# servicepassword-encryptionSecurity Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)OL-30243-017

Controlling Switch Access with Passwords and Privilege LevelsDisabling Password RecoveryStep 5Command or ActionPurposeendReturns to privileged EXEC mode.Example:Switch(config)# endStep 6show running-configVerifies your entries.Example:Switch# show running-configStep 7copy running-config startup-config(Optional) Saves your entries in the configuration file.Example:Switch# copy running-configstartup-configRelated TopicsAdditional Password Security, on page 2Example: Protecting Enable and Enable Secret Passwords with Encryption, on page 17Disabling Password RecoveryFollow these steps to disable password recovery to protect the security of your switch:Before You BeginIf you disable password recovery, we recommend that you keep a backup copy of the configuration file on asecure server in case the end user interrupts the boot process and sets the system back to default values. Donot keep a backup copy of the configuration file on the switch. If the switch is operating in VTP transparentmode, we recommend that you also keep a backup copy of the VLAN database file on a secure server. Whenthe switch is returned to the default system configuration, you can download the saved files to the switch byusing the Xmodem protocol.SUMMARY STEPS1. enable2. configure terminal3. system disable password recovery switch {all 1-9 }4. endSecurity Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)8OL-30243-01

Controlling Switch Access with Passwords and Privilege LevelsSetting a Telnet Password for a Terminal LineDETAILED STEPSStep 1Command or ActionPurposeenableEnables privileged EXEC mode. Enter your password if prompted.Example:Switch enableStep 2Enters the global configuration mode.configure terminalExample:Switch# configure terminalStep 3system disable password recovery switch {all Disables password recovery. 1-9 } all - Sets the configuration on switches in stack. 1-9 - Sets the configuration on the Switch Number selected.Example:Step 4Switch(config)# system disable passwordrecovery switch allThis setting is saved in an area of the flash memory that is accessibleby the boot loader and the Cisco IOS image, but it is not part of thefile system and is not accessible by any user.endReturns to privileged EXEC mode.Example:Switch(config)# endWhat to Do NextTo remove disable password recovery, use the no system disable password recovery switch all globalconfiguration command.Related TopicsPassword Recovery, on page 3Restrictions for Controlling Switch Access with Passwords and Privileges, on page 1Setting a Telnet Password for a Terminal LineBeginning in user EXEC mode, follow these steps to set a Telnet password for the connected terminal line:Before You Begin Attach a PC or workstation with emulation software to the switch console port, or attach a PC to theEthernet management port.Security Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)OL-30243-019

Controlling Switch Access with Passwords and Privilege LevelsSetting a Telnet Password for a Terminal Line The default data characteristics of the console port are 9600, 8, 1, no parity. You might need to pressthe Return key several times to see the command-line prompt.SUMMARY STEPS1. enable2. configure terminal3. line vty 0 154. password password5. end6. show running-config7. copy running-config startup-configDETAILED STEPSStep 1Command or ActionPurposeenableNoteExample:If a password is required for access to privileged EXECmode, you will be prompted for it.Enters privileged EXEC mode.Switch enableStep 2configure terminalEnters the global configuration mode.Example:Switch# configure terminalStep 3line vty 0 15Configures the number of Telnet sessions (lines), and enters lineconfiguration mode.Example:There are 16 possible sessions on a command-capable Switch. The0 and 15 mean that you are configuring all 16 possible Telnetsessions.Switch(config)# line vty 0 15Step 4password passwordExample:Switch(config-line)# password abcxyz543Step 5endSets a Telnet password for the line or lines.For password, specify a string from 1 to 25 alphanumeric characters.The string cannot start with a number, is case sensitive, and allowsspaces but ignores leading spaces. By default, no password isdefined.Returns to privileged EXEC mode.Example:Switch(config-line)# endSecurity Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)10OL-30243-01

Controlling Switch Access with Passwords and Privilege LevelsConfiguring Username and Password PairsStep 6Command or ActionPurposeshow running-configVerifies your entries.Example:Switch# show running-configStep 7copy running-config startup-config(Optional) Saves your entries in the configuration file.Example:Switch# copy running-configstartup-configRelated TopicsPreventing Unauthorized AccessTerminal Line Telnet Configuration, on page 3Example: Setting a Telnet Password for a Terminal Line, on page 18Configuring Username and Password PairsFollow these steps to configure username and password pairs:SUMMARY STEPS1. enable2. configure terminal3. username name [privilege level] {password encryption-type password}4. Use one of the following: line console 0 line vty 0 155. login local6. end7. show running-config8. copy running-config startup-configSecurity Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)OL-30243-0111

Controlling Switch Access with Passwords and Privilege LevelsConfiguring Username and Password PairsDETAILED STEPSStep 1Command or ActionPurposeenableEnables privileged EXEC mode. Enter your password if prompted.Example:Switch enableStep 2configure terminalEnters the global configuration mode.Example:Switch# configure terminalStep 3username name [privilege level] {passwordencryption-type password}Example:Switch(config)# username adamsampleprivilege 1 password secret456Switch(config)# username 111111111111mac attributeSets the username, privilege level, and password for each user. For name, specify the user ID as one word or the MAC address.Spaces and quotation marks are not allowed. You can configure a maximum of 12000 clients each, for bothusername and MAC filter. (Optional) For level, specify the privilege level the user has aftergaining access. The range is 0 to 15. Level 15 gives privilegedEXEC mode access. Level 1 gives user EXEC mode access. For encryption-type, enter 0 to specify that an unencryptedpassword will follow. Enter 7 to specify that a hidden passwordwill follow. For password, specify the password the user must enter to gainaccess to the Switch. The password must be from 1 to 25characters, can contain embedded spaces, and must be the lastoption specified in the username command.Step 4Use one of the following: line console 0Enters line configuration mode, and configures the console port (line0) or the VT

Related Topics DisablingPasswordRecovery,onpage8 PasswordRecovery,onpage3 Information About Passwords and Privilege