aaa认证
- [Huawei-aaa]
- aaa的含义
1 | 第一个a:身份 |
telnet: 用于远程管理设备
telnet,aaa认证远程登入
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27r1[g0/0/1]----[g0/0/1]-r2
1.更改r1和r2的设备名称
[Huawei] sysname r1
[Huawei] sysname r2
2.配置r1和r2的ip地址
[r1-g0/0/1] ip add 192.168.1.1 24
[r2-g0/0/1] ip add 192.168.1.2 24
3.r1配置telnet服务
[r1] telnet server enable (启动telne服务,ensp默认启动了的)
[r1] user-interface vty 0 4 (进入远程虚拟终端)
ps: vty 0 4,远程虚拟终端,0-4:同时允许5个用户接入
[r1-ui-vty0-4] authentication-mode aaa #启动aaa认证
[r1-ui-vty0-4] aaa #进入aaa
[r1-aaa] local-user test password cipher 123 #创建本地用户
[r1-aaa] local-user test service-type telnet #设置用户的类型
[r1-aaa] local-user cgg privilege level 3 #设置用户等级,0最低15最高依此类推
[r1-aaa] local-user cgg access-limit 1 #只允许单个用户登入
[r1-aaa] local-user cgg idle-timeout 0 50 #设置用户的超时间为50秒
[r1-aaa] local-user cgg state block #锁定用户,禁止登入
[r1-aaa] local-user cgg state active #解锁用户,允许登入
[r1-aaa] lcoal-user cgg ? #查看关于本地用户的设置
4.通过r2客户端进行测试
<r2> telnet 192.168.1.1
username: test
password: xxxx
info: xxxx
<r1>console:用于本地管理设备,一般用来初始化设备或者维修设备
console,aaa管理
1
2
3
4
5
6
7
8
9
10
11<r1[console_port]>------<[console_port]pc1>
1.配置r1
[Huawei] user-interface console 0 #进入console接口
[Huawei-ui-console0] authentication-mode aaa #添加aaa认证
[Huawei-ui-console0] aaa #进入aaa
[Huawei-aaa] local-user test password cipher 123 #添加用户
[Huawei-aaa] local-user test service-type terminal #设置用户的类型
2.进入pc1进行测试
username: test
password: xxx
[Huawei]console本地管理
1
2
3
4
5
61.配置r1
[Huawei] user-interface console 0
[Huawei-ui-console0] authentication-mode password #添加密码认证
[Huawei-ui-console0] set authentication password cipher 123 #设置密码
[Huawei-ui-console0] idle-time 0 30 #设置超时时间为30
[Huawei-ui-console0] idle-time 0 0 #永不超时