Controlling CLI Access
CLI Modes
User EXEC Mode
Privileged EXEC Mode
Configuration Mode
To protect access to the Privileged EXEC mode, use:
Custom Privilege Levels
These commands are not compatible with AAA mode of operation. By default, there are only 3 privilege levels:
Level 0 = no rights
Level 1 = User EXEC Mode
Level 15 = Privileged EXEC Mode
You can define new privilege levels and assign commands to them, so they can be ran by lower level users:
Role Based CLI Access
This feature is similar to the Custom Privilege levels, but it requires aaa new-model With this feature you can create custome views with different access to the CLI commands. First you need to be in the root view in order to create other views. To move to the root view, use:
To access the view, you can use the enable secret or password configured on the router. Then, go into the configuration mode and create a view, and specify a secret for it:
Then, start adding commands to the view, using a similar approach as with Custom Privilege Levels:
There’s also the option of configuring a super view. This view can only be a collection of other views:
You can move from one view to another using the command:
an AAA attribute (cli-view-name) can be passed from an AAA server to enable users automatic access to a view.
CLI Sessions
Local or Remote CLI
For Local access to the device you must use the Console or AUX port. To configure Local CLI access, use:
For remote CLI acces you must use Telnet or SSH to connect to the device. To configure remote CLI sessions, configure the Virtual Terminal Interfaces using:
Protecting line access
By default, the console and AUX ports allow access without asking for credentials. To enable the router to ask for credentials, use the command:
If line password is used but not defined, login will fail. To set the line password, use:
When using line password, you can also set the default privilege level of authenticated users:
When using locally defined users, you must first set a username:
The privilege level of the USER will be used when connecting on the line.
A VTY line can be used for both incoming and outgoing connections. You can define the protocols allowed on each line, using:
Protocols defined with the input keyword are allowed for connections to the terminal line, while protocols defined with the output keyword are protocols that can be used to connect from that line to another host.
Password Encryption
By default, when a configuration file is saved, passwords are saved in clear text. You can enable automatic encryption of passwords in the config files, using:
When the configuration files are saved remotely, the passwords are still sent in clear text. For better encryption, use secret instead of password when available
SSH
Before using SSH, a key must be generated, but to generate a key, you need a hostname and domain name.
SSH Server
SSH Client
SCP Server
AAA authentication must be enabled for SCP. To enable the SCP server, use:
The users must pass an aaa login authentication and an aaa exec authorization to use scp.
Last updated