路由与交换:Cisco交换机配置密码

本文详细介绍了如何配置Cisco交换机的Console口密码、特权密码和VTY口令,确保设备的安全远程访问。步骤包括进入不同配置模式、设置密码、启用登录验证以及保存配置。此外,还提到了VTY口令用于远程登录时的配置,包括设置本地登录和远程登录权限。通过这些配置,可以增强网络设备的安全性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

交换机配置密码

配置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  // 重启验证

image-20220408132759076
此时输入刚才设置的密码即可

配置特权密码

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密码即可登录,使用远程登录还需要设置特权密码,否则无法进入特权模式

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值