Show
VTY interface Console interface Privileged EXEC mode Upgrade to remove ads Only $1.99 / month Add your answer:Earn +20 pts Q: Passwords can be used to restrict access to all or parts of the Cisco IOS Select the modes and interfaces that can be protected with passwords? Write your answer... Still have questions? Still have questions? Made with 💙 in St. Louis Copyright ©2022 System1, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Answers. Configuring Security with Passwords, Privileges, and LoginsCisco IOS software-based networking devices provide several features that can be used to implement basic security for command-line sessions using only the operating system running on the device. These features include the following:
This module is a guide to implementing a baseline level of security for your networking devices. It focuses on the least complex options available for implementing a baseline level of security. If you have networking devices installed in your network with no security options configured, or you are about to install a networking device and you need help understanding how to implement a baseline of security, this document will help you.
Finding Feature InformationYour software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature 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 www.cisco.com/​go/​cfn. An account on Cisco.com is not required. Restrictions for Configuring Security with Passwords, Privileges, and LoginsYour networking device must not be configured to use any local or remote authentication, authorization, and accounting (AAA) security features. This document describes only the non-AAA security features that can be configured locally on the networking device. For information on how to configure AAA security features that can be run locally on a networking device, or for information on how to configure remote AAA security using TACACS+ or RADIUS servers, see the Securing User Services Configuration Guide Library . Information About Configuring Security with Passwords, Privileges, and Logins
Benefits of Creating a Security SchemeThe foundation of a good security scheme in the network is the protection of the user interfaces of the networking devices from unauthorized access. Protecting access to the user interfaces on your networking devices prevents unauthorized users from making configuration changes that can disrupt the stability of your network or compromise your network security. The features described in this document can be combined in many different ways to create a unique security scheme for each of your networking devices. You can enable nonadministrative users to run a subset of the administrative commands available on the networking device by lowering the entitlement level for the commands to the nonadministrative privilege level. This can be useful for the following scenarios: Cisco IOS CLI ModesTo aid in the configuration of Cisco devices, the Cisco IOS CLI is divided into different command modes. Each command mode has its own set of commands available for the configuration, maintenance, and monitoring of device and network operations. The commands available to you at any given time depending on the mode you are in. Entering a question mark (?) at the system prompt (device prompt) allows you to obtain a list of commands available for each command mode. The use of specific commands allows you to navigate from one command mode to another. The standard order in which a user would access the modes is as follows: user EXEC mode; privileged EXEC mode; global configuration mode; specific configuration modes; configuration submodes; and configuration subsubmodes.
Most EXEC mode commands are one-time commands, such as show or more commands, which show the current configuration status, and clear commands, which clear counters or interfaces. EXEC mode commands are not saved across reboots of the device. From privileged EXEC mode, you can enter global configuration mode. In this mode, you can enter commands that configure general system characteristics. You also can use global configuration mode to enter specific configuration modes. Configuration modes, including global configuration mode, allow you to make changes to the running configuration. If you later save the configuration, these commands are stored across device reboots. From global configuration mode you can enter a variety of protocol-specific or feature-specific configuration modes. The CLI hierarchy requires that you enter these specific configuration modes only through global configuration mode. For example, interface configuration mode is a commonly used configuration mode. From configuration modes, you can enter configuration submodes. Configuration submodes are used for the configuration of specific features within the scope of a given configuration mode. For example, the subinterface configuration mode is a submode of the interface configuration mode. ROM monitor mode is a separate mode used when the device cannot boot properly. If your system (router, switch, or access server) does not find a valid system image to load when it is booting, the system will enter ROM monitor mode. ROM monitor (ROMMON) mode can also be accessed by interrupting the boot sequence during startup. The following sections contain detailed information on these command modes.
User EXEC ModeWhen you start a session on a device, you generally begin in user EXEC mode, which is one of two access levels of the EXEC mode. For security purposes, only a limited subset of EXEC commands are available in user EXEC mode. This level of access is reserved for tasks that do not change the configuration of the device, such as determining the device status. If your device is configured to require users to log in the login process will require a username and a password. If you enter incorrect password three times, the connection attempt is refused. User EXEC mode is set by default to privilege level 1. Privileged EXEC mode is set by default to privilege level 15. For more information see the Privileged EXEC Mode. When you are logged in to a networking device in user EXEC mode your session is running at privilege level 1. When you are logged in to a networking device in privileged EXEC mode your session is running at privilege level 15. You can move commands to any privilege level between 1 and 15 using the privilege command. See the Cisco IOS Privilege Levels for more information on privilege levels and the privilege command. In general, the user EXEC commands allow you to connect to remote devices, change terminal line settings on a temporary basis, perform basic tests, and list system information. To list the available user EXEC commands, enter a question mark (?). The list of commands will vary depending on the software feature set and platform you are using. The user EXEC mode prompt consists of the hostname of the device followed by an angle bracket (>), for example, Device>. The default hostname is generally Device, unless it has been changed during initial configuration using the setup EXEC command. You can also change the hostname using the hostname global configuration command.
Privileged EXEC ModeIn order to have access to all commands, you must enter privileged EXEC mode, which is the second level of access for the EXEC mode. Normally, you must enter a password to enter privileged EXEC mode. In privileged EXEC mode, you can enter any EXEC command, because privileged EXEC mode is a superset of the user EXEC mode commands. Because many privileged EXEC mode commands set operating parameters, privileged EXEC level access should be password protected to prevent unauthorized use. The privileged EXEC command set includes those commands contained in user EXEC mode. Privileged EXEC mode also provides access to configuration modes through the configurecommand, and includes advanced testing commands, such as debug. Privileged EXEC mode is set by default to privilege level 15. User EXEC mode is set by default to privilege level 1. For more information see the User EXEC Mode. By default the EXEC commands at privilege level 15 are a superset of those available at privilege level 1. You can move commands to any privilege level between 1 and 15 using the privilege command. See the Cisco IOS Privilege Levels for more information on privilege levels and the privilege command. The privileged EXEC mode prompt consists of the hostname of the device followed by a pound sign (#), for example, Device#. To access privileged EXEC mode, use the enable command. If a privileged EXEC mode password has been configured the system will prompt you for a password after you issue the enable command. Use the exit command to leave privileged EXEC mode.
If a password has been configured on the system, you will be prompted to enter it before being allowed access to privileged EXEC mode. The password is not displayed on the screen and is case-sensitive. If an enable password has not been set, privileged EXEC mode can be accessed only by a local CLI session (terminal connected to the console port). If you attempt to access privileged EXEC mode on a device over a remote connection, such as aTelnet connection, and you have not configured a password for privileged EXEC mode, you will see the % No password set error message. For more information on remote connections see the Remote CLI Sessions. The system administrator uses the enable secret or enable passwordglobal configuration command to set the password that restricts access to privileged EXEC mode. For information on configuring a password for privileged EXEC mode, see the Protecting Access to Privileged EXEC Mode. To return to user EXEC mode, use the disable command: Note that the password will not be displayed as you type, but is shown here for illustrational purposes. To list the commands available in privileged EXEC mode, issue question mark (?) at the prompt. From privileged EXEC mode you can access global configuration mode, which is described in the following section.
Global Configuration ModeThe term “global” is used to indicate characteristics or features that affect the system as a whole. Global configuration mode is used to configure your system globally, or to enter specific configuration modes to configure specific elements such as interfaces or protocols. Use the configure terminalprivileged EXEC command to enter global configuration mode. To access global configuration mode, use the configure terminal command in privileged EXEC mode: Note that the system prompt changes to indicate that you are now in global configuration mode. The prompt for global configuration mode consists of the hostname of the device followed by (config) and the pound sign ( # ). To list the commands available in privileged EXEC mode, issue ? at the prompt. Commands entered in global configuration mode update the running configuration file as soon as they are entered. In other words, changes to the configuration take effect each time you press the Enter or Return key at the end of a valid command. However, these changes are not saved into the startup configuration file until you issue the copy running-config startup-config EXEC mode command. The system dialog prompts you to end your configuration session (exit configuration mode) by pressing the Control (Ctrl) and “z” keys simultaneously; when you press these keys, ^Z is printed to the screen. You can actually end your configuration session by entering the Ctrl-Z key combination, using the end command, and using the Ctrl-C key combination. The end command is the recommended way to indicate to the system that you are done with the current configuration session.
You can also use the exit command to return from global configuration mode to EXEC mode, but this only works in global configuration mode. Pressing Ctrl-Z or entering the end command will always take you back to EXEC mode regardless of which configuration mode or configuration submode you are in. To exit global configuration command mode and return to privileged EXEC mode, use the end or exit command. From global configuration mode, you can enter a number of protocol-specific, platform-specific, and feature-specific configuration modes. Interface configuration mode, described in the following section, is an example of a configuration mode you can enter from global configuration mode. Interface Configuration ModeOne example of a specific configuration mode you can enter from global configuration mode is interface configuration mode. Many features are enabled on a per-interface basis. Interface configuration commands modify the operation of an interface such as an Ethernet, FDDI, or serial port. Interface configuration commands always follow an interface global configuration command, which defines the interface type. For details on interface configuration commands that affect general interface parameters, such as bandwidth or clock rate, refer to the Cisco IOS Interface Configuration Guide . To access and list the interface configuration commands, use the interface type number command. To exit interface configuration mode and return to global configuration mode, enter the exit command. Configuration submodes are configuration modes entered from other configuration modes (besides global configuration mode). Configuration submodes are for the configuration of specific elements within the configuration mode. One example of a configuration submode is subinterface configuration mode, described in the following section. Subinterface Configuration ModeFrom interface configuration mode, you can enter subinterface configuration mode. Subinterface configuration mode is a submode of interface configuration mode. In subinterface configuration mode you can configure multiple virtual interfaces (called subinterfaces) on a single physical interface. Subinterfaces appear to be distinct physical interfaces to the various protocols. For detailed information on how to configure subinterfaces, refer to the appropriate documentation module for a specific protocol in the Cisco IOS software documentation set. To exit subinterface configuration mode and return to interface configuration mode, use the exit command. To end your configuration session and return to privileged EXEC mode, press Ctrl-Z or enter the end command. Cisco IOS CLI Sessions
Local CLI SessionsLocal CLI sessions require direct access to the console port of the networking device. Local CLI sessions start in user EXEC mode. See the Cisco IOS CLI Modes for more information on the different modes that are supported on your networking device. All of the tasks required to configure and manage a networking device can be done using a local CLI session. The most common method for establishing a local CLI session is to connect the serial port on a PC to the console port of the networking device and then to launch a terminal emulation application on the PC. The type of cable and connectors required and the settings for the terminal emulation application on the PC depend on the type of networking device that you are configuring. See the documentation for your networking device for more information on setting it up for a local CLI session. Remote CLI SessionsRemote CLI sessions are created between a host such as a PC and a networking device such as a router over a network using a remote terminal access application such as Telnet and SSH. Local CLI sessions start in user EXEC mode. See the Cisco IOS CLI Modes for more information on the different modes that are supported on your networking device. Most of the tasks required to configure and manage a networking device can be done using a remote CLI session. The exceptions are tasks that interact directly with the console port (such as recovering from a corrupted operating system (OS) by uploading a new OS image over the console port) and interacting with the networking device when it is in ROMMON mode. Telnet is the most common method for accessing a remote CLI session on a networking device.
Terminal Lines Used for Local and Remote CLI SessionsCisco networking devices use the word “lines” to refer to the software components that manage local and remote CLI sessions. You use the line console 0 global configuration command to enter line configuration mode to configure options, such as a password, for the console port. Remote CLI sessions use lines that are referred to as vty lines. You use the line vty line-number[ending-line-number]global configuration command to enter line configuration mode to configure options, such as a password, for remote CLI sessions. Protection of Access to Cisco IOS EXEC Modes
Protection of Access to User EXEC ModeThe first step in creating a secure environment for your networking device is protecting access to user EXEC mode by configuring passwords for local and remote CLI sessions. You can protect access to user EXEC mode for local CLI sessions by configuring a password on the console port. See the Configuring a Password for Local CLI Sessions. You can protect access to user EXEC mode for remote CLI sessions by configuring a password on the vtys. See the Configuring a Password for Remote CLI Sessions for instructions on how to configure passwords for remote CLI sessions. Protection of Access to Privileged EXEC ModeThe second step in creating a secure environment for your networking device is protecting access to privileged EXEC mode with a password. The method for protecting access to privileged EXEC mode is the same for local and remote CLI sessions. You can protect access to privileged EXEC mode by configuring a password for it. This is sometimes referred to as the enable password because the command to enter privileged EXEC mode is enable. Cisco IOS Password Encryption LevelsSome of the passwords that you configure on your networking device are saved in the configuration in plain text. This means that if you store a copy of the configuration file on a disk, anybody with access to the disk can discover the passwords by reading the configuration file. The following password types are stored as plain text in the configuration by default:
The following excerpt from a router configuration file shows examples of passwords and authentication keys that are stored as clear text: ! enable password O9Jb6D ! username username1 password 0 kV9sIj3 ! key chain trees key 1 key-string key1 ! interface Ethernet1/0.1 ip address 172.16.6.1 255.255.255.0 ip router isis ip rip authentication key-chain key2 ip authentication key-chain eigrp 1 key2 ip ospf authentication-key j7876 no snmp trap link-status isis password u7865k ! line vty 0 4 password V9jA5M ! You can encrypt these clear text passwords in the configuration file by using the service password-encryption command. This should be considered as a minimal level of security because the encryption algorithm used by the service password-encryption command to encrypt passwords creates text strings that can be decrypted using tools that are publicly available. You should still protect access to any electronic or paper copies of your configuration files after you use the service password-encryption command. The service password-encryption command does not encrypt the passwords when they are sent to the remote device. Anybody with a network traffic analyzer who has access to you network can capture these passwords from the packets as they are transmitted between the devices. See the Configuring Password Encryption for Clear Text Passwords for more information on encrypting clear text passwords in configuration files. Many of the Cisco IOS features that use clear text passwords can also be configured to use the more secure message digest algorithm 5 (MD5). The MD5 algorithm creates a text string in the configuration file that is much more difficult to decrypt. The MD5 algorithm does not send the password to the remote device. This prevents people using a traffic analyzer to capture traffic on your network from being able to discover your passwords. You can determine the type of password encryption that has been used by the number that is stored with the password string in the configuration file of the networking device. Cisco IOS CLI Session UsernamesAfter you have protected access to user EXEC mode and privileged EXEC mode by configuring passwords for them you can further increase the level of security on your networking device by configuring usernames to limit access to CLI sessions to your networking device to specific users. Usernames that are intended to be used for managing a networking device can be modified with additional options such as: See the Cisco IOS Security Command Reference for more information on how to configure the username command. Cisco IOS Privilege LevelsThe default configuration for Cisco IOS software-based networking devices uses privilege level 1 for user EXEC mode and privilege level 15 for privileged EXEC. The commands that can be run in user EXEC mode at privilege level 1 are a subset of the commands that can be run in privileged EXEC mode at privilege 15. The privilege command is used to move commands from one privilege level to another. For example, some ISPs allow their first level technical support staff to enable and disable interfaces to activate new customer connections or to restart a connection that has stopped transmitting traffic. See the Example: Configuring a Device to Allow Users to Shut Down and Enable Interfaces for an example of how to configure this option. The privilege command can also be used to assign a privilege level to a username so that when a user logs in with the username, the session runs at the privilege level specified by the privilege command. For example, if you want your technical support staff to view the configuration on a networking device which will help them to troubleshoot network problems without being able to modify the configuration, you can create a username, configure it with privilege level 15, and configure it to run the show running-config command automatically. When a user logs in with the username the running configuration will be displayed automatically. The user’s session will be logged out automatically after the user has viewed the last line of the configuration. See the Example: Configuring a Device to Allow Users to View the Running Configuration for an example of how to configure this option. To access the running configuration of a device using the show running-config command at a privilege level lower than level 15, see the Configuring a Device to Allow Users to View the Running Configuration task under the Protecting Access to Privileged EXEC Mode section. These command privileges can also be implemented when you are using AAA with TACACS+ and RADIUS. For example, TACACS+ provides two ways to control the authorization of router commands on a per-user or per-group basis. The first way is to assign privilege levels to commands and have the router verify with the TACACS+ server whether the user is authorized at the specified privilege level. The second way is to explicitly specify in the TACACS+ server, on a per-user or per-group basis, the commands that are allowed. For more information about implementing AAA with TACACS+ and RADIUS, see the technical note How to Assign Privilege Levels with TACACS+ and RADIUS . Cisco IOS Password ConfigurationCisco IOS software does not prompt you to repeat any passwords that you configure to verify that you have entered the passwords exactly as you intended. New passwords, and changes to existing passwords, go into effect immediately after you press the Enter key at the end of a password configuration command string. If you make a mistake when you enter a new password and have saved the configuration on the networking device to its startup configuration file and exited privileged EXEC mode before you realize that you made a mistake, you may find that you are no longer able to manage the device. The following are common situations that can happen:
To protect yourself from having to perform a lost password recovery procedure open two CLI sessions to the networking device and keep one of them in privileged EXEC mode while you reset the passwords using the other session. You can use the same device (PC or terminal) to run the two CLI sessions or two different devices. You can use a local CLI session and a remote CLI session or two remote CLI sessions for this procedure. The CLI session that you use to configure the password can also be used to verify that the password was changed properly. The other CLI session that you keep in privileged EXEC mode can be used to change the password again if you made a mistake the first time you configured it. You should not save password changes that you have made in the running configuration to the startup configuration until you have verified that your password was changed successfully. If you discover that you made a mistake configuring a password, and you were not able to correct the problem using the local and remote CLI session technique, you can power cycle the networking device so that it returns to the previous passwords that are stored in the startup configuration. Product Security Baseline Password Encryption and Complexity RestrictionsProduct security baseline (PSB) mandates basic security functions and features for all Cisco platforms and products. There are 12 priority security requirements out of the 110 mandatory requirements in version 2.0 of the product security baseline that must be met to allow the shipping of any product. The following two sections discuss restrictions that are relevant in AAA technology:
Password Complexity RestrictionsThe PSB states the following requirements for password complexity restrictions on Cisco products:
The first restriction need not be applied to passwords that are expected to be used via a numerical pin pad; in this case, passwords consisting only of digits are permitted. However, such passwords must be used only for access to messaging services, and not for general computer networking services. For an administrator to enable the restrictions, no particular default setting is required. Restrictions should be enabled by default on products that permit nonadministrative end users to change their own passwords. AAA enforces these restrictions on creating passwords used in a AAA context which includes passwords created using the username command and passwords created to download authorization data. The complexity restrictions are enabled or disabled using the aaa password restriction command. The behavior should be backward-compatible in allowing passwords that were configured before the complexity restrictions were enabled. The CLI should be disabled by default. When the CLI is enabled on a running device, the passwords configured prior to enabling the command should not be subject to the complexity restrictions. The passwords configured following the command should be subject to complexity restrictions. When a device is rebooted using a startup configuration containing the password complexity command enabled, the passwords present in the startup configuration should be allowed without the complexity restrictions; any passwords that are configured after the device has booted should be subject to the complexity restrictions. Protection of Stored CredentialsThe PSB states the following requirement for password complexity restrictions on Cisco products:
To be compliant with the PSB, AAA enforces the protection of stored credentials using SHA-256. Recovering from a Lost or Misconfigured Password for Local SessionsThree methods can be used to recover a lost or misconfigured password for local CLI sessions over console port. The method that you will use depends on the current configuration of your networking device. The following sections describes the three methods that can be used to recover a lost or misconfigured password:
Networking Device Is Configured to Allow Remote CLI SessionsThe fastest method to recover from a lost or misconfigured password for local CLI sessions is to establish a remote CLI session with the networking device and repeat the steps in the Configuring a Password for Local CLI Sessions. Your networking device must be configured to allow remote CLI sessions and you must know the remote CLI session password to perform this procedure. Networking Device Is Not Configured to Allow Remote CLI Sessions
Recovering from a Lost or Misconfigured Password for Remote SessionsThree methods that can be used to recover from a lost or misconfigured remote CLI session password. The method that you will use depends on the current configuration of your networking device.
Networking Device Is Configured to Allow Local CLI SessionsThe fastest method to recover from a lost or misconfigured password for remote CLI sessions is to establish a local CLI session with the networking device and repeat the steps in the Configuring a Password for Remote CLI Sessions. Your networking device must be configured to allow local CLI sessions and you must know the local CLI session password to perform this procedure. Networking Device Is Not Configured to Allow Local CLI Sessions
Recovering from Lost or Misconfigured Passwords for Privileged EXEC ModeTwo methods can be used to recover from a lost or misconfigured privileged EXEC mode password. The method that you will use depends on the current configuration of your networking device.
A Misconfigured Privileged EXEC Mode Password Has Not Been Saved
How to Configure Security with Passwords, Privileges, and Logins
Protecting Access to User EXEC Mode
Configuring a Password for Remote CLI SessionsThis task will assign a password for remote CLI sessions. After you have completed this task the networking device will prompt you for a password the next time that you start a remote CLI session with it. Cisco IOS software-based networking devices require that you have a password configured for remote CLI sessions. If you attempt to start a remote CLI session with a device that does not have a password configured for remote CLI sessions you will see a message that a password is required and the password is not set. The remote CLI session will be terminated by the remote host. If you have not previously configured a password for remote CLI sessions, you must perform this task over a local CLI session using a terminal or a PC running a terminal emulation application attached to the console port. Your terminal, or terminal emulation application, must be configured with the settings that are used by the console port on the networking device. The console ports on most Cisco networking devices require the following settings: 9600 baud, 8 data bits, 1 stop bit, no parity, and flow control is set to “none”. See the documentation for your networking device if these settings do not work for your terminal.
1. enable 2. configure terminal 3. line vty line-number
[ending-line-number] 4. password password 5. end 6. telnet ip-address 7. exit DETAILED STEPS
Troubleshooting TipsRepeat this task if you made a mistake when configuring the remote CLI session password. Configuring a Password for Local CLI SessionsThis task will assign a password for local CLI sessions over the console port. After you have completed this task, the networking device will prompt you for a password the next time that you start a local CLI session on the console port. This task can be performed over a local CLI session using the console port or a remote CLI session. If you want to perform the optional step of verifying that you have configured the password correctly you should perform this task using a local CLI session using the console port. If you want to perform the optional step of verifying the local CLI session password, you must perform this task using a local CLI session. You must have a terminal or a PC running a terminal emulation program connected to the console port of the networking device. Your terminal must be configured with the settings that are used by the console port on the networking device. The console ports on most Cisco networking devices require the following settings: 9600 baud, 8 data bits, 1 stop bit, no parity, and flow control set to “none”. See the documentation for your networking device if these settings do not work for your terminal. 1. enable 2. configure terminal 3. line console line-number 4.
password password 5. end 6. exit 7. Press the Enter key, and enter the password from Step 4 when prompted. DETAILED STEPS
Troubleshooting TipsIf your new password is not accepted proceed to the Configuration Examples for Configuring Security with Passwords Privileges and Logins for instructions on what to do next. Protecting Access to Privileged EXEC Mode
Configuring the Enable PasswordCisco no longer recommends that you use the enable password command to configure a password for privileged EXEC mode. The password that you enter with the enable passwordcommand is stored as plain text in the configuration file of the networking device. You can encrypt the password for the enable passwordcommand in the configuration file of the networking device using the service password-encryption command. However the encryption level used by the service password-encryption command can be decrypted using tools available on the Internet. Instead of using the enable passwordcommand, Cisco recommends using the enable secret commandbecause it encrypts the password that you configure with strong encryption. For more information on password encryption issues see the Cisco IOS Password Encryption Levels. For information on configuring the enable secretcommand see the Configuring the Enable Secret Password.
1. enable 2. configure terminal 3. enable password password 4. end 5. exit 6. enable DETAILED STEPS
Troubleshooting TipsIf your new password is not accepted, proceed to the Recovering from Lost or Misconfigured Passwords for Privileged EXEC Mode section for instructions on what to do next. Configuring Password Encryption for Clear Text PasswordsCisco IOS software stores passwords in clear text in network device configuration files for several features such as passwords for local and remote CLI sessions, and passwords for neighbor authentication for routing protocols. Clear text passwords are a security risk because anybody with access to archived copies of the configuration files can discover the passwords that are stored as clear text. The service password-encryptioncommand can be used to encrypt clear text commands in the configuration files of networking devices. See the Cisco IOS Password Encryption Levels for more information. Complete the following steps to configure password encryption for passwords that are stored as clear text in the configuration files of your networking device. You must have at least one feature that uses clear text passwords configured on your networking device for the service password-encryptioncommand to have any immediate effect. 1. enable 2. configure terminal 3. service password-encryption 4.
end DETAILED STEPS
Configuring the Enable Secret PasswordCisco recommends that you use the enable secret command, instead of the enable password command to configure a password for privileged EXEC mode. The password created by the enable secret command is encrypted with the more secure MD5 algorithm.
1. enable 2. configure terminal 3. Do one of the following: 4. end 5.
exit 6. enable DETAILED STEPS
Troubleshooting TipsIf your new password is not accepted proceed to the Recovering from Lost or Misconfigured Passwords for Privileged EXEC Mode for instructions on what to do next. Configuring a Device to Allow Users to View the Running ConfigurationTo access the running configuration of a device using the show running-config command at a privilege level lower than level 15, perform the following task. 1. enable 2. configure terminal 3. privilege exec all level level command-string 4. file privilege
level 5. privilege configure all level level command-string 6. end 7. show privilege 8. show running-config DETAILED STEPS
The following output for the show running-config command displays the logging configuration commands in the running configuration. Users with a privilege level below 15 can view the running configuration after configuring the privilege configure all level level command-string command. Device# show running-config Building configuration... Current configuration : 128 bytes ! boot-start-marker boot-end-marker ! no logging queue-limit logging buffered 10000000 no logging rate-limit ! ! ! end Configuring Security Options to Manage Access to CLI Sessions and CommandsThe tasks in this section describe how to configure your networking device to permit the use of a subset of privileged EXEC mode commands by users who should not have access to all of the commands that are available in privileged EXEC mode. These tasks are beneficial for companies that have multiple levels of network support staff and the company wants the staff at each level to have access to a different subset of the privileged EXEC mode commands. In this task the users who should not have access to all of the commands that are available in privileged EXEC mode are referred to as the first-line technical support staff. This section contains the following procedures:
Configuring the Networking Device for the First-Line Technical Support StaffThis task describes how to configure the networking device for first-line technical support users. First-line technical support staff are usually not allowed to run all of the commands available in privileged EXEC mode (privilege level 15) on a networking device. They are prevented from running commands that they are not authorized for by not being granted access to the password assigned to privileged EXEC mode or to other roles that have been configured on the networking device. The privilege command is used to move commands from one privilege level to another in order to create the additional levels of administration of a networking device that is required by companies that have different levels of network support staff with different skill levels. The default configuration of a Cisco IOS device permits two types of users to access the CLI. The first type of user is allowed to access only user EXEC mode. The second type of user is allowed access to privileged EXEC mode. A user who is allowed to access only user EXEC mode is not allowed to view or change the configuration of the networking device, or to make any changes to the operational status of the networking device. However, a user who is allowed access to privileged EXEC mode can make any change to a networking device that is allowed by the CLI. In this task the two commands that normally run at privilege level 15 are reset to privilege level 7 using the privilege command so that first-line technical support users will be allowed to run the two commands. The two commands for which the privilege levels will be reset are the clear counters command and reload command.
Any user that is permitted to know the enable secret password that is assigned to the first-line technical support user role privilege level can access the networking device as a first-line technical support user. You can add a level of security by configuring a username on the networking device and requiring that the users know the username and the password. Configuring a username as an additional level of security is described in the Configuring a Device to Require a Username for the First-Line Technical Support Staff. Before Cisco IOS Releases 12.0(22)S and 12.2(13)T, each command in a privilege level had to be specified with a separate privilege command. In Cisco IOS Releases 12.0(22)S, 12.2(13)T, and later releases, a “wildcard” option specified by the new keyword all was introduced that allows you to configure access to multiple commands with only one privilege command. By using the new all keyword, you can specify a privilege level for all commands which begin with the string you enter. In other words, the all keyword allows you to grant access to all command-line options and suboptions for a specified command. For example, if you wanted to create a privilege level to allow users to configure all commands which begin with service-module t1 (such as service-module t1 linecode or service-module t1 clock source) you can use the privilege interface all level 2 service-module t1 command instead of having to specify each service-module t1 command separately. If the command specified in the privilege command (used with the all keyword) enables a configuration submode, all commands in the submode of that command will also be set to the specified privilege level.
1. enable 2. configure terminal 3. enable secret level
level password 4. privilege exec level level command-string 5. privilege exec all level
level command-string 6. end DETAILED STEPS
Verifying the Configuration for the First-Line Technical Support StaffThis task describes how to verify that the network device is configured correctly for the first-line technical support staff. The following commands must have been modified to run at privilege level 7 for this task:
1. enable level password 2. show
privilege 3. clear counters 4. clear ip route * 5. reload in time 6.
reload cancel 7. disable 8. show privilege DETAILED STEPS
Troubleshooting TipsIf your configuration does not work the way that you want it to and you want to remove the privilege commands from the configuration, use the reset keyword for the privilege command to return the commands to their default privilege level. For example, to remove the command privilege exec level reload command from the configuration and return the reload command to its default privilege of 15 use the privilege exec reset reloadcommand. Configuring a Device to Require a Username for the First-Line Technical Support StaffThis task configures the networking device to require that the first-line technical support staff log in to the networking device with a login name of admin. The admin username configured in this task is assigned the privilege level of 7, which will allow users who log in with this name to run the commands that were reassigned to privilege level 7 in the Configuring the Networking Device for the First-Line Technical Support Staff task. When a user successfully logs in with the admin username, the CLI session will automatically enter privilege level 7. Before Cisco IOS Releases 12.0(18)S and 12.2(8)T, two types of passwords were associated with usernames: Type 0, which is a clear text password visible to any user who has access to privileged mode on the router, and type 7, which has a password encrypted by the service password encryption command. In Cisco IOS Releases 12.0(18)S, 12.2(8)T, and later releases, the new secret keyword for the username command allows you to configure MD5 encryption for username passwords. The following commands must have been modified to run at privilege level 7 for this task:
See the Configuring the Networking Device for the First-Line Technical Support Staff for instructions on how to change the privilege level for a command.
1. enable 2. configure terminal 3. username username privilege
level secret password 4. end 5. disable 6. login 7. show privilege 8.
clear counters 9. clear ip route * 10. reload in time 11. reload cancel 12. disable 13. show privilege DETAILED STEPS
Configuration Examples for Configuring Security with Passwords, Privileges, and Logins
Example: Configuring a Device to Allow Users to Clear Remote SessionsThe following example shows how to configure a networking device to allow a nonadministrative user to clear remote CLI session vty lines. The first section is an excerpt of the running configuration for this example. The following sections show you how this example is used. The following section is an excerpt of the running configuration: ! privilege exec level 7 clear line ! no aaa new-model ! ! username admin privilege 7 secret 5 $1$tmIw$1aM7sadKhWMpkVTzxNw1J. ! privilege exec level 7 clear line ! ! the privilege exec level 7 clear command below is entered automatically ! when you enter the privilege exec level 7 clear line command above, do ! not enter it again ! privilege exec level 7 clear ! The following section using the login command shows the user logging in to the networking device with the username of admin: Device> login Username: admin Password: The following section using the show privilege command shows that the current privilege level is 7: Device# show privilege Current privilege level is 7 The following section using the show user command shows that two users (admin and root) are currently logged in to the networking device: Device# show user Line User Host(s) Idle Location * 0 con 0 admin idle 00:00:00 2 vty 0 root idle 00:00:17 172.16.6.2 Interface User Mode Idle Peer Address The following section using the clear line command terminates the remote CLI session in use by the username root: Device# clear line 2 [confirm] [OK] The following section using the show user command shows that admin is the only user logged in to the networking device: Device# show user Line User Host(s) Idle Location * 0 con 0 admin idle 00:00:00 Interface User Mode Idle Peer Address Example: Configuring a Device to Allow Users to View the Running ConfigurationFor Users With Privilege Level 15The following example shows how to configure a networking device to allow a nonadministrative users (no access to privileged EXEC mode) to view the running configuration automatically. This example requires that the username is configured for privilege level 15 because many of the commands in the configuration file can be viewed only by users who have access to privilege level 15. The solution is to temporarily allow the user access to privilege level 15 while running the show running-config command and then terminating the CLI session when the configuration file has been viewed. In this example the networking device will automatically terminate the CLI session when the end of the configuration file has been viewed. No further configuration steps are required.
! ! username viewconf privilege 15 noescape secret 5 $1$zA9C$TDWD/Q0zwp/5xRwRqdgc/. username viewconf autocommand show running-config ! For Users With Privilege Level Lower Than Level 15The following example shows how to configure a networking device to allow a user with privilege level lower than level 15 to view the running configuration. Device> enable Device# configure terminal Device(config)# privilege exec all level 5 show running-config Device(config)# file privilege 5 Device(config)# privilege configure all level 5 logging Device(config)# end Device# show privilege Current privilege level is 5 Device# show running-config Building configuration... Current configuration : 128 bytes ! boot-start-marker boot-end-marker ! no logging queue-limit logging buffered 10000000 no logging rate-limit ! ! ! end Example: Configuring a Device to Allow Users to Shut Down and Enable InterfacesThe following example shows how to configure a networking device to allow nonadministrative users to shut down and enable interfaces. The first section is an excerpt of the running configuration for this example. The following sections show you how this example is used. The following section is an excerpt of the running configuration: ! no aaa new-model ! username admin privilege 7 secret 5 $1$tmIw$1aM7sadKhWMpkVTzxNw1J. ! privilege interface all level 7 shutdown privilege interface all level 7 no shutdown privilege configure level 7 interface privilege exec level 7 configure terminal ! ! the privilege exec level 7 configure command below is entered automatically ! when you enter the privilege exec level 7 configure terminal command above, do ! not enter it again ! privilege exec level 7 configure ! The following section using the login command shows the user logging in to the networking device with the username of admin: Device> login Username: admin Password: The following section using the show privilege command shows that the current privilege level is 7: Device# show privilege Current privilege level is 7 The following section using the show user command shows that admin is the only user logged in to the networking device: Device# show user Line User Host(s) Idle Location * 0 con 0 admin idle 00:00:00 Interface User Mode Idle Peer Address The following section shows that the admin user is permitted to shut down and enable an interface: Device# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Device(config)# interface ethernet 1/0 Device(config-if)# shutdown Device(config-if)# no shutdown Device(config-if)# exit Device# Where to Go NextOnce you have established a baseline of security for your networking devices you can consider more advanced options such as:
Additional ReferencesRelated Documents
Technical Assistance
Feature Information for Configuring Security with Passwords, Privileges, and LoginsThe following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature. Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.
What modes and interfaces can be protected with passwords?Explanation: Access to the VTY and console interfaces can be restricted using passwords. Out-of-band management of the router can be restricted in both user EXEC and privileged EXEC modes.
Can be used to restrict access to all or parts of the Cisco IOS?Passwords can be used to restrict access to all or parts of the Cisco IOS.
Which two functions are provided to users by the context sensitive help feature of Cisco IOS cli quizlet?Context-sensitive help provides the user with a list of commands and the arguments associated with those commands within the current mode of a networking device. A syntax checker provides error checks on submitted commands and the TAB key can be used for command completion if a partial command is entered.
|