Telnet的三种登录方式
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配置远程管理的案例展示
>.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>
.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>
>.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的三种登录方式的更多相关文章
- 基于ftp服务的三种登录方式及其相关的访问控制和优化
ftp(简单文件传输协议),是一种应用广泛的网络文件传输协议和服务,占用20和21号端口,主要用于资源的上传和下载. 在linux对于ftp同widows一样具有很多的种类,这里主要介绍vsfptd( ...
- Spring Security构建Rest服务-1202-Spring Security OAuth开发APP认证框架之重构3种登录方式
SpringSecurityOAuth核心源码解析 蓝色表示接口,绿色表示类 1,TokenEndpoint 整个入口点,相当于一个controller,不同的授权模式获取token的地址都是 /oa ...
- linux学习之centos(二):虚拟网络三种连接方式和SecureCRT的使用
---操作环境--- 虚拟机版本:VMware Workstation_10.0.3 Linux系统版本:CentOS_6.5(64位) 物理机系统版本:win10 一.虚拟网络三种连接方式 当在V ...
- MVC-AOP思想-Filter 三种注册方式
在ASP.NET MVC框架中,为我们提供了四种类型的Filter类型包括:IAuthorizationFilter.IActionFilter.IResultFilter.IExceptionFil ...
- python-web自动化-三种等待方式
当有元素定位不到时,比如下拉框,弹出框等各种定位不到时:一般是两种问题:1 .有frame :2.没有加等待 下面学习三种等待方式: 1.强制等待 sleep(xx)这种方法简单粗暴,不管浏览器是否加 ...
- Linux基石【第二篇】虚拟网络三种连接方式(转载)
在虚拟机上安装完Centos系统后,开始配置静态IP,以方便在本宿主机上可以访问虚拟机,在曲折的配置中,了解到虚拟机还有三种连接方式:Bridged,NAT和Host-only,于是,我又一轮新的各种 ...
- MVC-AOP(面向切面编程)思想-Filter 三种注册方式
在ASP.NET MVC框架中,为我们提供了四种类型的Filter类型包括:IAuthorizationFilter.IActionFilter.IResultFilter.IExceptionFil ...
- python笔记-20 django进阶 (model与form、modelform对比,三种ajax方式的对比,随机验证码,kindeditor)
一.model深入 1.model的功能 1.1 创建数据库表 1.2 操作数据库表 1.3 数据库的增删改查操作 2.创建数据库表的单表操作 2.1 定义表对象 class xxx(models.M ...
- Django-多对多关系的三种创建方式-forms组件使用-cookie与session-08
目录 表模型类多对多关系的三种创建方式 django forms 组件 登录功能手写推理过程 整段代码可以放过来 forms 组件使用 forms 后端定义规则并校验结果 forms 前端渲染标签组件 ...
随机推荐
- git学习心得
https://github.com/zhangxinn/test/tree/master 自己虽然在课堂上有认真的听老师讲解如何使用github,包括怎样在线学习,怎样在github上建立自己的仓库 ...
- 剑指offer:树的子结构
题目描述: 输入两棵二叉树A,B,判断B是不是A的子结构.(ps:我们约定空树不是任意一个树的子结构) 解题思路: 同样考虑用递归来做. 利用两个递归函数,一个用于判断两棵树树否相等,另一个递归取A的 ...
- ionic2添加 android平台出现的问题
nodejs版本不宜过高 cordova版本不宜过高 此情况应采取 cordova platform add android --nofetch
- NodeJS 学习记录
这里是我学习NodeJs的学习记录 URL:网址解析的好帮手 URL,URI 首先,URI是uniform resource identifier,统一资源标识符,用来唯一的标识一个资源.而URL是u ...
- pandas函数应用
1.管道函数 #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/5/24 15:03 # @Author : zhang cha ...
- XHTML 簡介
XTML是可擴展的超文本標記語言. XHTML是比HTML更加嚴謹的HTML語言. 所有的瀏覽器都能識別XHTML. XHTML符合W3C標準,是為了替代HTML的.
- BZOJ3028 食物(生成函数)
显然构造出生成函数:则有f(x)=(1+x2+x4+……)·(1+x)·(1+x+x2)·(x+x3+x5+……)·(1+x4+x8+……)·(1+x+x2+x3)·(1+x)·(1+x3+x6+…… ...
- JSP 和 Servlet 的工作原理和生命周期
JSP的英文名叫Java Server Pages,翻译为中文是Java服务器页面的意思,其底层就是一个简化的Servlet设计,是由sum公司主导参与建立的一种动态网页技术标准.Servlet 就是 ...
- 使用JQuery进行DOM操作
获得内容 - text().html() 以及 val() 三个简单实用的用于 DOM 操作的 jQuery 方法: text() - 设置或返回所选元素的文本内容 html() - 设置或返回所选元 ...
- day30 __new__ 以及单例模式
__new__ # __new__ # object.__new__() class A : def __init__(self): self.x = 1 print("init执行啦&qu ...