设置思科设备console密码、enable密码、vty登录密码 | 您所在的位置:网站首页 › 英语console是什么意思 › 设置思科设备console密码、enable密码、vty登录密码 |
思科设备各级密码:1) console密码 SW2(config)#line console 0SW2(config-line)#password ciscoSW2(config-line)#login //启用密码认证,默认没有,需要加上去SW2(config-line)#login local //本地开启用户认证SW2(config)username xiao password fan //创建本地用户SW2(config)username xiao privilege 15 password fan //以该用户登入设备后直接进入特权模式说明---对用户的权限定义0-15级,最高为15,任何命令都可操作SW2(config)service password-encryption //明文密码加密 2) 特权模式密码(设置全局密码)SW2>enadleSW2(config)#configure terminal 1.(config)#enable password en cisco←密码encisco 2.(config)#enable secret jmcisco←密码jmcisco #2个同时设,只有secret 有效,因为其优先极高(config)#login enadleSW2(config)#configure terminalSW2(config)#line vty 0 4SW2(config-line)#password telnetciscoSW2(config-line)#login //默认就有SW2(config-line)#login local //开启本地用户认证,使用本地用户数据库SW2(config-line)no login //不需要密码就可登陆 telnet登入交换机或路由器,若不设置line vty密码,则默认客户端不能远程访问到设备ctrl + shift + 6一起松开再按X即退出show users/who 查看当前有哪些用户存在,console段是自己登陆到别的设备,vty段是别人登录到自己这端,*代表自己登陆用的lineshow sessions 显示当前所有会话show line 显示当前所有线路,*代表有用户在线的lineR#disconnect 2 断开由自己建立的会话2R#clear line 3 关闭别的设备登录到自己的会话3 ssh登入设备:只能以username和password登入设备端做配置:ip domain name cisco #设置交换机domaincrypto key generatehostname cisco //要有domain name和hostnameusername cisco password cisco在vty下:login localtransport input ssh //只允许以ssh方式登入,telnet时抓包可以看到用户和密码,ssh采用非对称加密技术,比telnet安全登入端登入命令:ssh -l cisco 3.3.3.3
关于Cisco IOS 的登录密码以及权限分配设置 enable password xxxx 初级密码,用于验证从用户模式到特权模式的验证 enable secret xxxxx MD5加密密码 用法同上 enabl password level xx 指定密码作用于哪个级别 enable secret level xx 作用同上 R2(config)#enable password ? 0 Specifies an UNENCRYPTED password will follow 7 Specifies a HIDDEN password will follow LINE The UNENCRYPTED (cleartext) 'enable' password level Set exec level password R2(config)#enable secret ? 0 Specifies an UNENCRYPTED password will follow 5 Specifies an ENCRYPTED secret will follow LINE The UNENCRYPTED (cleartext) 'enable' secret level Set exec level password 注意这里:0 5 7 的 含义不同。0 为不加密,5 为MD5 。7 为Cisco自有加密算法(不牢靠,容易被破解) service password-encryption 是使用7的加密方法加密存储在本地的所有密码。Cisco官方不推荐使用这个方法。 简单密码验证: console 验证配置: line console 0 password xxxx end Vty 验证: line vty 0 4 password xxxx end 带用户名的密码验证: username xxxx secret xxx line console 0 login local end line vty 0 4 login local end 分级的权限验证: 我只想让Level 7 的用户在特权模式下:clear counters 和reload 配置如下: privilege exec level 7 clear counters privilege exec level 7 reload enable secret level 7 xxxx 或者 privilege exec level 7 clear counters privilege exec level 7 reload username xxx privilege 7 secret xxxx 这种模式下:要登录必须这样: R1>login username:xxx password:xxx 个人比较喜欢的一套分级权限的完整配置: privilege exec level 7 clear counters privilege exec level 7 reload username xxx privilege 7 secret xxxx username xxx privilege 15 secret xxx (管理员登录) line console 0 login local line vty 0 4 login local 对于,show run 来说, 如果Level 7 的用户被授权能够show run 但是其他的仍未被授权的话,查看的show run 将是如下样子: R1#show run Building configuration... Current configuration : 53 bytes ! boot-start-marker boot-end-marker ! ! ! ! ! ! end 其原因是因为未给Level 7 的用户授权 Global Configuration 权利 现在我授权如下: privilege Configure leve 7 interface 然后再Level 7 下,show run 可以看见如下: R1#show run Building configuration... Current configuration : 237 bytes ! boot-start-marker boot-end-marker ! ! ! ! ! interface Ethernet0/0 ! interface Ethernet0/1 ! interface Ethernet0/2 ! interface Ethernet0/3 ! interface Serial1/0 ! interface Serial1/1 ! interface Serial1/2 ! interface Serial1/3 ! ! end 注意这里,这里可以看见接口了。所以说对于show run 来说,必须先授权才能查看相应内容~ 顺便解释下 关于enable secret password的问题: R1(config)#enable secret ? 0 Specifies an UNENCRYPTED password will follow 5 Specifies an ENCRYPTED secret will follow LINE The UNENCRYPTED (cleartext) 'enable' secret level Set exec level password 这里,很多人都不知道 0 5 的区别。 或者误认为0 是不加密密码,5 则是加密密码。 其实对于Secret 选项来说,密码肯定是会被加密的。 假设我要设置的密码为cisco 而这里的0 是指:我现在即将输入的密码是原始密码,是:cisco 而如果是5 的话:就是输入cisco 的MD5值:$1$XNRo$8FSa/XSF9DbmF6VbK6L6K.
|
CopyRight 2018-2019 实验室设备网 版权所有 |