Telnet的三种登录方式

                                              作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.华为创建telnet的三种验证方式

  首先,我们可以简单的看一个拓扑图,让我们可以在亦庄的路由器上对双桥的路由器进行操作。

1.无验证登录(none方式)

给需要远程的路由器配置一个互联的IP地址即可:

 “亦庄机房”配置如下:
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]ip address 172.30.1.1 24
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei-Ethernet0/0/1]quit
6 [huawei]sysname yizhuang

在需要远程的路由器上需要开启Telnet服务:

“双桥机房”配置如下:
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]ip address 172.30.1.2 24
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei-Ethernet0/0/1]quit
[Huawei]telnet server enable #开启telnet功能
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode none #设置认证模式
[Huawei-ui-vty0-4]user privilege level 3 #指定登录账号的级别
10[huawei]sysname shuangqiao

测试:

 [yizhuang]interface Ethernet 0/0/1
[yizhuang-Ethernet0/0/1]display this #查看当前接口信息
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[yizhuang-Ethernet0/0/1]ping 172.30.1.2 #检查是否能和互联地址ping通
PING 172.30.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.30.1.2: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 172.30.1.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 172.30.1.2: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms --- 172.30.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/38/50 ms [yizhuang-Ethernet0/0/1]quit
[yizhuang]quit
<yizhuang>telnet 172.30.1.2 #远程双桥地址
Trying 172.30.1.2 ...
Press CTRL+K to abort
Connected to 172.30.1.2 ... Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2017-04-18 18:15:39.
<shuangqiao> #登录成功,显示的双桥的主机名
<shuangqiao>
<shuangqiao>

  很显然:上面不用输入任何信息就能登录,没有安全性可言,谁都能远程你的设备,所以,这种配置我们一般不采取,除非我们在做实验的时候会用,好吧~anyway,忘记它吧。

2.基于用户名验证(password登录方式)

清华园路由器配置:

 “清华园机房”配置如下:
<Huawei>system-view
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]ip address 172.30.1.1 24
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei]sysname qinghuayuan

廊坊路由器配置:

 “廊坊机房”配置如下:
<Huawei>system-view
[Huawei]sysname langfang
[langfang]interface Ethernet 0/0/1
[langfang-Ethernet0/0/1] ip address 172.30.1.2 24
[langfang-Ethernet0/0/1]undo shutdown
[langfang-Ethernet0/0/1]quit
[langfang]telnet server enable
[langfang]user-interface vty 0 4
[langfang-ui-vty0-4]authentication-mode password #认真的模式
[langfang-ui-vty0-4]set authentication password simple yinzhengjie #设置明文密码是“yinzhengjie”

测试结果如下:

 [qinghuayuan-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[qinghuayuan-Ethernet0/0/1]ping 172.30.1.2
PING 172.30.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.30.1.2: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=4 ttl=255 time=60 ms
Reply from 172.30.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms --- 172.30.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/48/60 ms [qinghuayuan-Ethernet0/0/1]
<qinghuayuan>telnet 172.30.1.2
Trying 172.30.1.2 ...
Press CTRL+K to abort
Connected to 172.30.1.2 ... Login authentication Password: #在此处输入密码
Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2017-04-18 18:28:18.
<langfang> #密码输出正确登录成功
<langfang>

3.基于用户名和密码验证

兆维机房配置如下:

 “兆维机房”配置如下:
<Huawei>system-view
[Huawei]sysname zhaowei
[zhaowei]interface Ethernet 0/0/1
[zhaowei-Ethernet0/0/1]ip address 172.30.1.1 24
[zhaowei-Ethernet0/0/1]undo shutdown
[zhaowei-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[zhaowei-Ethernet0/0/1]
[zhaowei-Ethernet0/0/1]quit

鲁谷机房配置如下:

 “鲁谷机房”配置如下:
<Huawei>system-view
[Huawei]sysname lugu
[lugu]interface Ethernet 0/0/1
[lugu-Ethernet0/0/1]ip address 172.30.1.2 24
[lugu-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.2 255.255.255.0
#
return
[lugu-Ethernet0/0/1]
[lugu-Ethernet0/0/1]undo shutdown
[lugu-Ethernet0/0/1]quit
[lugu]user-interface vty 0 4
[lugu-ui-vty0-4]authentication-mode aaa
[lugu-ui-vty0-4]user privilege level 3
[lugu-ui-vty0-4]quit
[lugu]aaa #进入aaa配置模式,这是华为的一个特色,哈哈
[lugu-aaa]local-user yinzhengjie password cipher 123 #创建一 个用户是尹正杰,密码是用密文加密的是""
[lugu-aaa]local-user yinzhengjie service-type telnet #只给 yinzhengjie 这个用户telnet的权限
[lugu-aaa]quit
[lugu]super password simple yinzhengjie #设置用户模式进入系统 配置模式的密码为yinzhengjie,加密格式是明文的哟,可以用dis cu 来查看到这个密码,建议设置成密文。根据你的重要性了 

测试:

 测试:

 [zhaowei-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[zhaowei-Ethernet0/0/1]ping 172.30.1.2
PING 172.30.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.30.1.2: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 172.30.1.2: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 172.30.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 172.30.1.2: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=5 ttl=255 time=40 ms --- 172.30.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/44/60 ms [zhaowei-Ethernet0/0/1]
<zhaowei>telnet 172.30.1.2
Trying 172.30.1.2 ...
Press CTRL+K to abort
Connected to 172.30.1.2 ... Login authentication Username:yinzhengjie
Password:
Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2017-04-18 18:56:35.
<lugu>

二.华为配置远程的主要命令说明

 [yinzhengjie]aaa
[yinzhengjie-aaa]local-user yinzhengjie password cipher 123
[yinzhengjie-aaa]local-user yinzhengjie privilege level
[yinzhengjie-aaa]local-user yinzhengjie service-type telnet
[yinzhengjie-aaa]quit
[yinzhengjie]user-interface vty
[yinzhengjie-ui-vty0-]authentication-mode aaa
[yinzhengjie-ui-vty0-]user privilege level
[yinzhengjie-ui-vty0-]protocol inbound telnet
[yinzhengjie-ui-vty0-]quit
[yinzhengjie]telnet server enable

三.H3C配置远程管理的案例展示

网络拓扑图实验:
 

1.不需要验证(none,该方式不推荐使用,一般都是你在实验的时候可以这样配置,现实中切记不要使用哟!)
 >.R1路由器配置如下
[R1]interface GigabitEthernet /
[R1-GigabitEthernet0/]ip address 172.30.1.1
[R1-GigabitEthernet0/]undo shutdown
[R1-GigabitEthernet0/]quit
[R1]telnet server enable ------开启Telnet服务
[R1]user-interface vty
[R1-line-vty0-]authentication-mode none
[R1-line-vty0-]user-role level- ------->指定登录账号的级别
[R1-line-vty0-] >.R2路由器配置如下
[R2]interface GigabitEthernet /
[R2-GigabitEthernet0/]ip address 172.30.1.2
[R2-GigabitEthernet0/]undo shutdown
[R2-GigabitEthernet0/]ping 172.30.1.1
Ping 172.30.1.1 (172.30.1.1): data bytes, press CTRL_C to break
bytes from 172.30.1.1: icmp_seq= ttl= time=1.067 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.590 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.640 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.605 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.578 ms --- Ping statistics for 172.30.1.1 ---
packets transmitted, packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.578/0.696/1.067/0.187 ms
[R2-GigabitEthernet0/]%Feb ::: R2 PING//PING_STATISTICS: Ping statistics for 172.30.1.1: packets transmitted, packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.578/0.696/1.067/0.187 ms. [R2-GigabitEthernet0/]quit
[R2]quit
<R2>telnet 172.30.1.1 ------->这里我们就开始Telnet设备R1,只要2个设备连通就可以远程上去了
Trying 172.30.1.1 ...
Press CTRL+K to abort
Connected to 172.30.1.1 ... ******************************************************************************
* Copyright (c) - Hangzhou H3C Tech. Co., Ltd. All rights reserved. *
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
****************************************************************************** <R1>
2.只需要密码验证(password)
 .R1路由器配置如下:
[R1]interface GigabitEthernet /
[R1-GigabitEthernet0/]ip address 172.30.1.1
[R1-GigabitEthernet0/]undo shutdown
[R1-GigabitEthernet0/]quit
[R1]telnet server enable
[R1]user-interface vty
[R1-line-vty0-]authentication-mode password ----->开启认证模式为password模式
[R1-line-vty0-]set authentication password simple ------>设置认证密码为123(明文哟)
[R1-line-vty0-]user-role level- ------->设置账户的等级为15级
[R1-line-vty0-] >.R2路由器配置如下
[R2]interface GigabitEthernet /
[R2-GigabitEthernet0/]IP address 172.30.1.2
[R2-GigabitEthernet0/]undo shutdown
[R2-GigabitEthernet0/]quit
[R2]quit
<R2>telnet 172.30.1.1 ------->开始远程R1路由器
Trying 172.30.1.1 ...
Press CTRL+K to abort
Connected to 172.30.1.1 ... ******************************************************************************
* Copyright (c) - Hangzhou H3C Tech. Co., Ltd. All rights reserved. *
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
****************************************************************************** Password: ------->我们需要设置R1设置的密码, 即“”
<R1>
<R1>
<R1>
3.需要用户名和密码验证(scheme方式)
 >.R1路由器配置如下:
[R1]interface GigabitEthernet /
[R1-GigabitEthernet0/]IP address 172.30.1.1
[R1-GigabitEthernet0/]undo shutdown
[R1-GigabitEthernet0/]quit
[R1]telnet server enable
[R1]user-interface vty
[R1-line-vty0-]authentication-mode scheme ------>开启用户名密码登录方式
[R1-line-vty0-]user-role level-
[R1-line-vty0-]quit
[R1]local-user yinzhengjie
New local user added.
[R1-luser-manage-yinzhengjie]password simple ------>设置明文密码为""
[R1-luser-manage-yinzhengjie]service-type telnet ----->设置服务类型及优先级
[R1-luser-manage-yinzhengjie]quit
[R1]super password simple ------>这里我们设置了普通视图进入系统视图的密码,个别用户是需要输入这个密码才可以登录进来的哟! >.R2路由器配置如下:
[R2]interface GigabitEthernet /
[R2-GigabitEthernet0/]ip address 172.30.1.2
[R2-GigabitEthernet0/]undo shutdown
[R2-GigabitEthernet0/]quit
[R2]quit
<R2>telnet 172.30.1.1
Trying 172.30.1.1 ...
Press CTRL+K to abort
Connected to 172.30.1.1 ... ******************************************************************************
* Copyright (c) - Hangzhou H3C Tech. Co., Ltd. All rights reserved. *
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
****************************************************************************** login: yinzhengjie ----->这里我们输入在R1上配置的用户名“yinzhengjie”
Password: ------>这里我们输入用户名“yinzhengjie”对应的密码“”
<R1>
<R1>

Telnet的三种登录方式的更多相关文章

  1. 基于ftp服务的三种登录方式及其相关的访问控制和优化

    ftp(简单文件传输协议),是一种应用广泛的网络文件传输协议和服务,占用20和21号端口,主要用于资源的上传和下载. 在linux对于ftp同widows一样具有很多的种类,这里主要介绍vsfptd( ...

  2. Spring Security构建Rest服务-1202-Spring Security OAuth开发APP认证框架之重构3种登录方式

    SpringSecurityOAuth核心源码解析 蓝色表示接口,绿色表示类 1,TokenEndpoint 整个入口点,相当于一个controller,不同的授权模式获取token的地址都是 /oa ...

  3. linux学习之centos(二):虚拟网络三种连接方式和SecureCRT的使用

    ---操作环境--- 虚拟机版本:VMware Workstation_10.0.3 Linux系统版本:CentOS_6.5(64位) 物理机系统版本:win10  一.虚拟网络三种连接方式 当在V ...

  4. MVC-AOP思想-Filter 三种注册方式

    在ASP.NET MVC框架中,为我们提供了四种类型的Filter类型包括:IAuthorizationFilter.IActionFilter.IResultFilter.IExceptionFil ...

  5. python-web自动化-三种等待方式

    当有元素定位不到时,比如下拉框,弹出框等各种定位不到时:一般是两种问题:1 .有frame :2.没有加等待 下面学习三种等待方式: 1.强制等待 sleep(xx)这种方法简单粗暴,不管浏览器是否加 ...

  6. Linux基石【第二篇】虚拟网络三种连接方式(转载)

    在虚拟机上安装完Centos系统后,开始配置静态IP,以方便在本宿主机上可以访问虚拟机,在曲折的配置中,了解到虚拟机还有三种连接方式:Bridged,NAT和Host-only,于是,我又一轮新的各种 ...

  7. MVC-AOP(面向切面编程)思想-Filter 三种注册方式

    在ASP.NET MVC框架中,为我们提供了四种类型的Filter类型包括:IAuthorizationFilter.IActionFilter.IResultFilter.IExceptionFil ...

  8. python笔记-20 django进阶 (model与form、modelform对比,三种ajax方式的对比,随机验证码,kindeditor)

    一.model深入 1.model的功能 1.1 创建数据库表 1.2 操作数据库表 1.3 数据库的增删改查操作 2.创建数据库表的单表操作 2.1 定义表对象 class xxx(models.M ...

  9. Django-多对多关系的三种创建方式-forms组件使用-cookie与session-08

    目录 表模型类多对多关系的三种创建方式 django forms 组件 登录功能手写推理过程 整段代码可以放过来 forms 组件使用 forms 后端定义规则并校验结果 forms 前端渲染标签组件 ...

随机推荐

  1. Asp.net框架与SpringMvc框架简单分析

    (此文为自我总结,错误很多请勿借鉴) 1.就前两天分析SpringMvc框架中是通过controler来实现跳转页面,通过mapping来实现数据连接 分析的方法又通过java的类之间进行相互调用,个 ...

  2. 非post请求时整个url作为参数传递出现bug

    在非post请求使用整个url作为参数传递到后台时会出现url被截断的bug,这时通过encodeURIComponent进行url的编码可以解决.示例如下: <!--参数url-->Ur ...

  3. Activiti的部署问题

    http://www.kafeitu.me/activiti/2012/03/22/workflow-activiti-action.html 既可以通过每次Spring应用程序启动时,执行部署命令. ...

  4. Mind Manager X 10 registry backup key under windows XP

    Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Mindjet\MindManager\10] [HKEY_CURRE ...

  5. Sqlserver 系统视图简单说明

    1. 查看系统视图的sql语句 select * from sys.system_views 2. 查看所有的 dynamic management 视图的sql select * from sys. ...

  6. [转载]oracle 高水位线详解

    一.oracle 高水位线详解 出处: https://www.cnblogs.com/linjiqin/archive/2012/01/15/2323030.html 一.什么是水线(High Wa ...

  7. pandas函数应用

    1.管道函数 #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/5/24 15:03 # @Author : zhang cha ...

  8. 关于pycharm的debugger配置问题(包含启用py.test测试)

    今天才发现了一个刷新三观的问题.那就是 pycharm的底层集成的debugger功能其实是依赖于几个测试框架.. 现在由于要写基于pytest的测试,但是如果到zsh里面去跑命令,明显是效率很低下的 ...

  9. 使用DataContext和ItemsSource将数据源绑定到ListView上的区别

    在最近的一个项目中,将DataView类型的数据源绑定到ListView控件时,发现当DataView的内容发生变化时,前台的ListView控件的内容并没有发生改变,在这里我先贴出前台要绑定数据源的 ...

  10. 【Mysql】—— 索引的分类

    注意:索引是在存储引擎中实现的,也就是说不同的存储引擎,会使用不同的索引.MyISAM和InnoDB存储引擎:只支持BTREE索引,也就是说默认使用BTREE,不能够更换.MEMORY/HEAP存储引 ...