实验目的

1. 理解Telnet与SSH的运行原理

2. 掌握Telnet与SSH的配置方法

实验拓扑

实验需求

1、根据实验拓扑图,完成设备的基本配置;

2、SW1允许R1通过Telnet远程管理,VTY密码为xmws;

3、R2允许R1通过SSH version2远程管理,用户名为xmws,密码为wisdom,域名为xmws.cn。

实验步骤

步骤1:设备的基本配置

配置R1

Router>enable

Router#configure terminal

Router(config)#hostname R1

R1(config)#no ip domain-lookup

R1(config)#line console 0

R1(config-line)#exec-timeout 0 0

R1(config-line)#logging synchronous

R1(config-line)#exit

R1(config)#enable password xmws

R1(config)#interface ethernet0/0

R1(config-if)#ip address 192.168.1.254 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#exit

R1(config)#interface ethernet0/1

R1(config-if)#ip address 192.168.12.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#end

R1#

配置R2

Router>enable

Router#configure terminal

Router(config)#hostname R2

R2(config)#no ip domain-lookup

R2(config)#line console 0

R2(config-line)#exec-timeout 0 0

R2(config-line)#logging synchronous

R2(config-line)#exit

R2(config)#enable password xmws

R2(config)#interface ethernet0/0

R2(config-if)#ip address 192.168.12.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#end

R2#

配置SW1

Switch>enable

Switch#configure terminal

Switch(config)#hostname SW1

SW1(config)#no ip domain-lookup

SW1(config)#line console 0

SW1(config-line)#exec-timeout 0 0

SW1(config-line)#logging synchronous

SW1(config-line)#exit

SW1(config)#enable password xmws   //必须设置,否则Telnet上SW1后无法进入特权模式

SW1(config)#interface vlan 1

SW1(config-if)#ip address 192.168.1.1 255.255.255.0

SW1(config-if)#no shutdown

SW1(config-if)#exit

SW1(config)#ip default-gateway 192.168.1.254

SW1(config)#end

SW1#

步骤2:配置Telnet

配置SW1

SW1>enable

SW1#configure terminal

SW1(config)#line vty 0 4   //进入VTY

SW1(config-line)#password xmws   //设置Telnet登录的密码为xmws

SW1(config-line)#login   //启用密码

SW1(config-line)#transport input telnet   //允许通过Telnet远程登录

SW1(config-line)#end

SW1#

步骤3:配置SSH

配置R2

R2>enable

R2#configure terminal

R2(config)#username xmws password wisdom   //创建用户名和密码

R2(config)#ip ssh version 2   //启用SSH版本2

R2(config)#ip domain-name xmws.cn   //定义域名

R2(config)#crypto key generate rsa   //生成密钥

The name for the keys will be: R2.xmws.cn

Choose the size of the key modulus in the range of 360 to 4096 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   //SSHv2密钥长度至少768位

% Generating 1024 bit RSA keys, keys will be non-exportable...

[OK] (elapsed time was 0 seconds)

R2(config)#

R2(config)#line vty 0 4

R2(config-line)#login local   //使用用户名和密码验证

R2(config-line)# transport input ssh   //允许通过SSH远程登录

R2(config-line)#end

R2#

实验检查

步骤1:Telnet测试

R1#telnet 192.168.1.1Trying 192.168.1.1 ... OpenUser Access VerificationPassword:SW1>   //成功登录SW1
注意,如果SW1没有设置Enable密码,R1登录到SW1后输Enable会出现如下提示:R1#telnet 192.168.1.1Trying 192.168.1.1 ... OpenUser Access VerificationPassword:SW1>enable% No password set
同时按<Ctrl+Shit+6>组合键,然后再按x把界面切回R1R1#show sessions   //查看R1打开的Telnet会话Conn Host                Address             Byte  Idle Conn Name*  1 192.168.1.1         192.168.1.1            6     5 192.168.1.1R1#resume 1   //重新连接到SW1[Resuming connection 1 to 192.168.1.1 ... ]SW1>

步骤2:检查Telnet

SW1#show users   //SW1上查看谁登录到自己Line User Host(s) Idle Location*  0 con 0  idle   00:00:00      2 vty 0  idle   00:02:47 192.168.1.254  Interface User   Mode        Idle     Peer AddressLocation表示是谁登录到自己,192.168.1.254是R1。SW1#clear line 2   //清除R1的Telnet连接[confirm] [OK]SW1#show users    Line       User       Host(s)              Idle       Location*  0 con 0                idle                 00:00:00     Interface    User               Mode         Idle     Peer AddressR1已经被清除。

步骤3:SSH测试

R1#ssh -l xmws 192.168.12.2

Password:

R2>enable

Password:

R2#   //成功登录到R2

步骤4:检查SSH

R2#show ssh Connection Version Mode Encryption Hmac State  Username0    1.99 IN aes128-ctr  hmac-sha2-256 Session started       xmws0    1.99 OUT aes128-ctr  hmac-sha2-256 Session started     xmws

【实操】配置Telnet与SSH相关推荐

  1. 锐捷RG-S3760交换机配置Telnet、SSH、DHCP示例

    第一章--锐捷RG-S3760交换机配置Telnet.SSH.DHCP示例 作者: 陈诺.宋琦杏.李文佳.杨佳佳.何嘉愉    排版: 赖裕鑫    审核: 蔡宗唐 锐捷设备配置教学系列文章: 第一章 ...

  2. 锐捷RG-S5750交换机配置Telnet、SSH、DHCP、密码恢复、配置保存、删除配置等示例

    第三章-- 锐捷RG-S5750交换机配置Telnet.SSH.DHCP.密码恢复.配置保存.删除配置等示例 锐捷设备配置教学系列文章: 第一章 锐捷RG-S3760交换机配置Telnet.SSH.D ...

  3. 锐捷AP(AP520,AP720,AP3320)配置Telnet、SSH、DHCP示例

    第二章-- 锐捷AP(AP520,AP720,AP3320)配置Telnet.SSH.DHCP示例 作者: 邓茂臻,王乐平,刘国凯,魏荣,符月    排版: 赖裕鑫    审核: 蔡宗唐 锐捷设备配置 ...

  4. 华为路由器/交换机配置telnet,ssh远程登录

    华为路由器/交换机配置telnet,ssh远程登录 文章目录 华为路由器/交换机配置telnet,ssh远程登录 1. Telnet 1.1 新建账号 1.2 配置远程访问 1.3 客户端远程访问 1 ...

  5. 华为ensp使用Cloud 配置telnet、ssh远程连接

    一.配置telnet: 使用真机远程连接ENSP交换机(真机IP地址配置到VirtualBox Host-Only Ethernet Adapter网卡) 在自己的电脑上打开网络连接,然后你可以看到V ...

  6. 华为ensp 配置telnet、ssh远程连接

    一.配置telnet: 使用真机(自己的电脑)远程连接交换机(真机IP地址配置到VirtualBox Host-Only Ethernet Adapter网卡) 真机的IP 在自己的电脑上打开网络连接 ...

  7. 华为S5700交换机初始化和配置telnet,ssh用户方法

    通过串口线配置S5700 的管理IP地址和网关,串口线接在交换机的console口,ip设置完成后网线接在ETH口: <Quidway> system-view               ...

  8. 锐捷交换机配置Telnet、ssh远程登录

    远程登录Telnet Ruijie(config)# line vty first-line [last-line] 进入 Line配置模式,VTY是远程登录 Ruijie(config-line)# ...

  9. 配置telnet和SSH

    1.设置enable密码 R5(config)#enable password cisco 2.开启telnet,并设置telnet密码 R5#conf t R5(config)#line vty 0 ...

最新文章

  1. SpringAOP中通过JoinPoint获取值,并且实现redis注解
  2. 时间怎么算用计算机,抖音珍惜时间计算器怎么用
  3. Geek的入门神器:micropython-能跑python的stm32开发板
  4. 世界上迄今为止最安全的加密算法
  5. Kubernetes(k8s)底层网络原理刨析
  6. 四年STM32研发的工作感悟
  7. 南京信息工程大学计算机与科学专业,南京信息工程大学王牌专业有哪些及专业排名...
  8. C++多线程传参详解
  9. 如何使用Blender制作360度全景图和全景视频?
  10. 【程序人生】有个程序员男朋友是什么体验?被公开吐槽
  11. Python程序员难招人?月入30K程序员告诉你答案
  12. linux cp命令复制整个文件夹
  13. Docker基础入门详解
  14. kibana Unable to connect to Elasticsearch at http://elasticsearch:9200.
  15. 银行排队信息预测系统数学建模
  16. 【ES6基础】Map与WeakMap
  17. Python_机器学习_常用科学计算库_第6章_ Seaborn+综合案例
  18. 双目运算符和三目运算符的使用浅谈
  19. 江苏教育和科研计算机网,江苏省实行义务教育学籍网络化管理
  20. node.js+uni计算机毕设项目基于微信小程序的车位共享系统LWPPT(程序+小程序+LW)

热门文章

  1. 自行开发驱动如何进行驱动签名
  2. CSS层叠样式表进阶
  3. PE学习(一)masm32开发环境和ollyICE使用
  4. C/C++将十进制数转为二进制并输出
  5. 2021春季每日一题【week4 完结】
  6. 第三章 搜索与图论 【完结】
  7. 手把手教你写C语言的动态库的开发
  8. 创建两个相同名称的文件夹
  9. Java多线程两种实现方式的对比
  10. Aux函数java,verse.aux