交换机配置密码
配置Console口密码
Switch>enable // 进入特权模式
Switch#configure terminal // 进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#line console ?
<0-0> First Line number
Switch(config)#line console 0 // 进入console口配置
Switch(config-line)#password happy // 设置console口密码为 happy
Switch(config-line)#login // 启用特权密码
Switch(config-line)#end // 退到特权模式也可以用 exit
Switch#copy running-config startup-config // 保存配置,防止重启丢失 或者使用 write
Switch#reload // 重启验证
此时输入刚才设置的密码即可
配置特权密码
Switch>enable
Switch#configure terminal // 进入全局配置
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#enable ?
password Assign the privileged level password // 特权不加密密码,即明文显示
secret Assign the privileged level secret // 特权加密密码,即密文显示
Switch(config)#enable secret happy
// Switch(config)# service password-encryption ――将所有口令进行加密
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#
VTY 口令
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#line vty ?
<0-15> First Line number
Switch(config)#line vty 0 ?
<1-15> Last Line number
<cr>
Switch(config)#line vty 0 4 // 表示 0-4 五个接口
Switch(config-line)#login -- 让设备回显要求输入口令的提示
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
Switch(config-line)#password happy // 设置密码
Switch(config-line)#exec-timeout 10 0
Switch(config-line)#login // 启用密码
Switch(config-line)#exit
Switch(config)#username hh pas
Switch(config)#username hh password happy
Switch(config)#line vty 0 4
Switch(config-line)#login local // 设置本地登录,自动续保本地创建的用户名和密码,就是上面创建的
Switch(config-line)#exit
Switch(config)#
Switch(config)#
Vty口令用于远程登录,使用telnet连接,输入vty密码即可登录,使用远程登录还需要设置特权密码,否则无法进入特权模式