第三章用户访问和权限管理 3.1. 设置用户名和密码 提问 为每个单独的人员设置不同的用户名和密码 回答 Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#username neoshi password ioscookbook (username weak nopassword) Router1(config)#aaa new-model Router1(config)#aaa authentication login local_auth local Router1(config)#line vty 0 4 Router1(config-line)#login authentication local_auth Router1(config-line)#exit Router1(config)#end Router1# 注释 设置单独的用户名和密码的好处就不用多说了,这里只提一个就是在日志中会显示谁做了修改,比如%SYS-5-RELOAD: Reload requested by kdooley on vty0 (172.25.1.1).另外在 username 这个命令里面还有一个autocommand 的选项,实现登录以后自动执行某个特定的命令的作用,下面 的例子就是一个用户名为run 无密码,登录以后显示完端口状态就自动退出的例子,很好用吧 Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#aaa new-model Router1(config)#aaa authentication login default local Router1(config)#aaa authorization exec default local Router1(config)#username run nopassword noescape Router1(config)#username run autocommand show ip interface brief Router1(config)#end Router1# 3.2. 加密密码 提问 加密密码从而在配置文件中不明文显示 回答 Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#enable password oreilly Router1(config)#line vty 0 4 Router1(config-line)#password cookbook Router1(config-line)#line con 0 Router1(config-line)#password cookbook Router1(config-line)#line aux 0 Router1(config-line)#password cookbook Router1(config-line)#exit Router1(config)#service password-encryption Router1(config)#end Router1# 注释 这种加密方式很弱,很容易被破解 3.3. Using Better Password-Encryption Techniques 提问 使用强度高的加密方式而不是思科缺省的加密技术 回答 Router1#configure...