0基础学RS(四)路由器交换机安全管理访问telnet、ssh配置

实验拓扑

在这里插入图片描述
首先给R1接口配置IP地址
R1(config)#interface gigabitEthernet 0/0/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0

PC1配置IP地址(用于验证)
在这里插入图片描述
在这里插入图片描述

配置特权EXEC密码

R1(config)#enable password cisco
配置明文密码cisco

R1(config)#enable secret cisco
配置加密密码cisco

R1#show running-config (查看配置信息)
可以看到secret密码是加密的,password显示的明文密码
在这里插入图片描述
补充:
R1(config)#security passwords min-length 6
设置最短密码长度为6

R1(config)#service password-encryption
加密所有明文密码
可以看到之前的cisco被加密了
在这里插入图片描述

线路安全配置

VTY安全设置

vty使用了两种登陆方式Telnet和ssh
telnet是不加密的远程登录方式,使用抓包软件可以抓到明文用户名和密码
ssh是一种加密的远程登录方式,使用抓包软件抓到的是加密的用户名密码

Telnet登陆

R1(config)#line vty 0 4 进入vty接口
R1(config-line)#password class 配置密码class
% Password too short - must be at least 6 characters. Password not configured 提示密码最短长度为6
R1(config-line)#password class123 重新配置了密码class123
R1(config-line)#login 启用密码验证

验证:
在这里插入图片描述
在这里插入图片描述
vty的默认登陆方式为Telnet
输入vty密码class123
进入特权模式输入密码cisco
注:密码在上面设置的
在这里插入图片描述

ssh登陆

第一步:
R1#show ip ssh
使用show ip ssh命令验证交换机是否支持 SSH

第二步:
R1(config)#ip domain-name cisco.com
使用全局配置命令ip domain-name domain-name 配置网络的 IP 域名

第三步:
R1(config)#crypto key generate rsa
The name for the keys will be: R1.cisco.com
Choose the size of the key modulus in the range of 360 to 2048 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes.
How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be non-exportable…[OK]
生成RSA密钥对

第四步:
R1(config)#username admin secret cisco123
创建用户名密码

第五步:
R1(config)#line vty 0 15
R1(config-line)#transport input ssh
R1(config-line)#login local
R1(config-line)#exit
R1(config)#

进入vty接口
启用ssh
使用本地数据库验证
退出vty

第六步:
R1(config)#ip ssh version 2
启用ssh版本2

验证:
ssh -l(这个是小写L)
在这里插入图片描述

console安全配置

R1(config)#line console 0
R1(config-line)#password ciscocon
R1(config-line)#login
R1(config-line)#exit
R1(config)#
验证:
先用console线将pc和R1连起来
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
点击ok就能通过console口访问R1了
在这里插入图片描述
在这里输入的密码是ciscocon
进入特权EXEC模式的密码是cisco
在这里插入图片描述
注:在packet tracer里面点击路由器交换机的CLI界面就是通过console口访问的。

交换机的配置和路由器基本一,下面是补充连接。
交换机配置管理访问

在后面还讲解了关于Cisco IOS登陆增强特性0基础学RS(六)配置登陆增强特性

各位大佬有不同的观点,欢迎在评论区留言

  • 6
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

网工小王

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值