三、设备密码 1、密码配置 Outside1(config)#enable ? last-resort Define enable action if no TACACS servers respond password Assign the privileged level password //未加密的密码 secret Assign the privileged level secret //加密密码 use-tacacs Use TACACS to check enable passwords 注意:当一台设备中同时配置了password和secret时,secret有效。 Outside1(config)#enable password ? 0 Specifies an UNENCRYPTED password will follow //无安全级别的密码配置 7 Specifies a HIDDEN password will follow //思科的专有加密协议 LINE The UNENCRYPTED (cleartext) 'enable' passw认方式配置加密信ord //按默息 level Set exec level password //指定加密级别,级别从1~15,默认的加密级别是15。 2、用户登录方式的密码设置 Outside1(config)#line ? <0-6> First Line number aux Auxiliary line //用于设置辅助端口的用户模式密码。用于连接调制解调器的端口 console Primary terminal line //用于设置控制台的用户模式。 vty Virtual terminal //设置telnet登录方式的用户模式。 3、实例:配置控制台登录信息 Outside1(config)#line console 0 Outside1(config-line)#exec-timeout ? <0-35791> Timeout in minutes Outside1(config-line)#exec-timeout 5 //配置自动退出时间为5分钟 Outside1(config-line)#logging synchronous //配置信息同步 Outside1(config-line)#password 7 xmht //使用思科专业加密方式设置密码为“xmht” Outside1(config-line)#login //启动密码配置信息 4、实例:配置远程登录密码信息 Outside1(config)#line vty 0 ? <1-15> Last Line number <cr> Outside1(config)#line vty 0 4 //配置远程登录的方式 Outside1(config-line)#exec-timeout 5 Outside1(config-line)#logging sy Outside1(config-line)#password 7 xmht Outside1(config-line)#login //启动密码配置信息 5、实例:SSH 通过以上配置,发现登录方式中的密码配置均为明码配置,安全性不高。可以通过SSH协议提高登录密码的安全性。 Router(config)#hostname Todd //设置设备名 Todd(config)#ip domain-name Lammle.com //设置域名为Lammle.com Todd(config)#crypto key generate rsa //设置SSH的加密方式为RSA的加密方式 The name for the keys will be: Todd.Lammle.com Choose the size of the key modulus in the range of 360 to 2048 for your【提示加密字符的长度从360到2048】 General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes. How many bits in the modulus [512]: 1024 【默认加密的位数为512,配置中指定为1024】 % Generating 1024 bit RSA keys, keys will be non-exportable...[OK] Todd(config)#line vty 0 15 //配置远程登录信息 Todd(config-line)#transport input ssh //将远程登录信息与SSH 协议进行连接 6、实例:level参数功能的应用 (1)设置加密级别 Router(config)#enable secret level 13 k13 Router(config)#enable secret level 12 k12 Router(config)#enable secret level 15 k15 Router(config)#enable secret level 1 k1 (2)验证加密级别 Router>en //若直接输入en,后未跟【1-14】的任何数字,代表登录的安全级别是15。 Password: //登录密码是“15” Router>en 13 //若en后加入【1-14】中的任何一个数字,代表登录的安全级别是该数字。 Password: //登录密码是“13” |
|
来自: Teacher_Lin > 《网络设备基本配置》