详解ACL限制SSH、Telnet远程登录及抓包实验

2024-08-28 17:44

本文主要是介绍详解ACL限制SSH、Telnet远程登录及抓包实验,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 要求:lsw5只能lsw6登录,lsw6只能PC2登录

<Huawei>sys
[Huawei]sysname sw2
[sw2]int vlanif1
[sw2-Vlanif1]ip address 192.168.10.2 24
[sw2-Vlanif1]q
[sw2]
<Huawei>sys
[Huawei]sysname sw1
[sw1]int vlanif1
[sw1-Vlanif1]ip address 192.168.10.1 24
[sw2-Vlanif1]q
[sw2]
<Huawei>sys
[Huawei]sysname sw3
[sw3]int vlanif1
[sw3-Vlanif1]ip address 192.168.10.3 24
[sw3-Vlanif1]q
[sw3]
<sw2>sys
[sw2]user-interface vty 0 4
[sw2-ui-vty0-4]authentication-mode aaa
[sw2-ui-vty0-4]protocol inbound ?all     All protocolsssh     SSH protocoltelnet  Telnet protocol
[sw2-ui-vty0-4]protocol inbound telnet 
[sw2]aaa
[sw2-aaa]local-user telsw2 password cipher 123456 privilege level 15
[sw2-aaa]local-user telsw2 service-type telnet 
<sw3>telnet 192.168.10.2
Trying 192.168.10.2 ...
Press CTRL+K to abort
Connected to 192.168.10.2 ...Login authenticationUsername:telsw2
Password:
Info: The max number of VTY users is 5, and the numberof current VTY users on line is 1.The current login time is 2024-08-27 10:03:11.
<sw2>
[sw2]dis cu
#
sysname sw2
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaaauthentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user admin password simple adminlocal-user admin service-type httplocal-user telsw2 password cipher %NS[+B0ZNI]NZPO3JBXBHA!!local-user telsw2 privilege level 15local-user telsw2 service-type telnet
#
interface Vlanif1ip address 192.168.10.2 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4authentication-mode aaa
#
return
[sw2]
<sw3>telnet 192.168.10.2
Trying 192.168.10.2 ...
Press CTRL+K to abort
Connected to 192.168.10.2 ...Login authenticationUsername:telsw2
Password:
Info: The max number of VTY users is 5, and the numberof current VTY users on line is 1.The current login time is 2024-08-27 10:18:18.
<sw2>
[sw1]user-interface vty 0 4
[sw1-ui-vty0-4]authentication-mode aaa
[sw1-ui-vty0-4]protocol inbound ssh 
[sw1-ui-vty0-4]aa
[sw1-aaa]
[sw1-aaa]local-user sshsw1 password cipher 123456 privilege level 15
Info: Add a new user.
[sw1-aaa]local-user sshsw1 service-type ssh 
[sw1]stelnet server enable 
Info: Succeeded in starting the Stelnet server.
[sw1]ssh user sshsw1 authentication-type password 
Info: Succeeded in adding a new SSH user.
[sw1]ssh user sshsw1 service-type stelnet 
[sw1]rsa local-key-pair create
The key name will be: sw1_Host
The range of public key size is (512 ~ 2048). 
NOTES: If the key modulus is greater than 512, it will take a few minutes.
Input the bits in the modulus[default = 512]:2048
Generating keys...
.........................................................................+++
.......................................+++
.......................++++++++
.++++++++[sw1]
[sw3]stelnet 192.168.10.1
Please input the username:sshsw1
Trying 192.168.10.1 ...
Press CTRL+K to abort
Connected to 192.168.10.1 ...
Error: Failed to verify the server's public key.
Please run the command "ssh client first-time enable"to enable the first-time ac
cess function and try again.
[sw3]ssh client first-time enable
[sw3]
Aug 27 2024 11:04:46-08:00 sw3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw3]ste	
[sw3]stelnet 192.168.10.1
Please input the username:sshsw1
Trying 192.168.10.1 ...
Press CTRL+K to abort
Connected to 192.168.10.1 ...
The server is not authenticated. Continue to access it? [Y/N] :y
Save the server's public key? [Y/N] :
Aug 27 2024 11:05:47-08:00 sw3 %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[0]:The server h
ad not been authenticated in the process of exchanging keys. When deciding wheth
er to continue, the user chose Y.y
The server's public key will be saved with the name 192.168.10.1. Please wait...Aug 27 2024 11:05:55-08:00 sw3 %%01SSH/4/SAVE_PUBLICKEY(l)[1]:When deciding whet
her to save the server's public key 192.168.10.1, the user chose Y.
Enter password:
Info: The max number of VTY users is 5, and the numberof current VTY users on line is 1.The current login time is 2024-08-27 11:06:00.
<sw1>
[sw1]acl 2000
[sw1-acl-basic-2000]rule permit source 192.168.10.2 0.0.0.0
[sw1]user-interface vty 0 4
[sw1-ui-vty0-4]acl 2000 inbound SW3访问中断
[sw3]stelnet 192.168.10.1
Please input the username:sshsw1
Trying 192.168.10.1 ...
Press CTRL+K to abort

这篇关于详解ACL限制SSH、Telnet远程登录及抓包实验的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1115454

相关文章

如何通过海康威视设备网络SDK进行Java二次开发摄像头车牌识别详解

《如何通过海康威视设备网络SDK进行Java二次开发摄像头车牌识别详解》:本文主要介绍如何通过海康威视设备网络SDK进行Java二次开发摄像头车牌识别的相关资料,描述了如何使用海康威视设备网络SD... 目录前言开发流程问题和解决方案dll库加载不到的问题老旧版本sdk不兼容的问题关键实现流程总结前言作为

SQL 中多表查询的常见连接方式详解

《SQL中多表查询的常见连接方式详解》本文介绍SQL中多表查询的常见连接方式,包括内连接(INNERJOIN)、左连接(LEFTJOIN)、右连接(RIGHTJOIN)、全外连接(FULLOUTER... 目录一、连接类型图表(ASCII 形式)二、前置代码(创建示例表)三、连接方式代码示例1. 内连接(I

Go路由注册方法详解

《Go路由注册方法详解》Go语言中,http.NewServeMux()和http.HandleFunc()是两种不同的路由注册方式,前者创建独立的ServeMux实例,适合模块化和分层路由,灵活性高... 目录Go路由注册方法1. 路由注册的方式2. 路由器的独立性3. 灵活性4. 启动服务器的方式5.

Java中八大包装类举例详解(通俗易懂)

《Java中八大包装类举例详解(通俗易懂)》:本文主要介绍Java中的包装类,包括它们的作用、特点、用途以及如何进行装箱和拆箱,包装类还提供了许多实用方法,如转换、获取基本类型值、比较和类型检测,... 目录一、包装类(Wrapper Class)1、简要介绍2、包装类特点3、包装类用途二、装箱和拆箱1、装

Go语言中三种容器类型的数据结构详解

《Go语言中三种容器类型的数据结构详解》在Go语言中,有三种主要的容器类型用于存储和操作集合数据:本文主要介绍三者的使用与区别,感兴趣的小伙伴可以跟随小编一起学习一下... 目录基本概念1. 数组(Array)2. 切片(Slice)3. 映射(Map)对比总结注意事项基本概念在 Go 语言中,有三种主要

Python中Markdown库的使用示例详解

《Python中Markdown库的使用示例详解》Markdown库是一个用于处理Markdown文本的Python工具,这篇文章主要为大家详细介绍了Markdown库的具体使用,感兴趣的... 目录一、背景二、什么是 Markdown 库三、如何安装这个库四、库函数使用方法1. markdown.mark

PLsql Oracle 下载安装图文过程详解

《PLsqlOracle下载安装图文过程详解》PL/SQLDeveloper是一款用于开发Oracle数据库的集成开发环境,可以通过官网下载安装配置,并通过配置tnsnames.ora文件及环境变... 目录一、PL/SQL Developer 简介二、PL/SQL Developer 安装及配置详解1.下

使用Navicat工具比对两个数据库所有表结构的差异案例详解

《使用Navicat工具比对两个数据库所有表结构的差异案例详解》:本文主要介绍如何使用Navicat工具对比两个数据库test_old和test_new,并生成相应的DDLSQL语句,以便将te... 目录概要案例一、如图两个数据库test_old和test_new进行比较:二、开始比较总结概要公司存在多

css渐变色背景|<gradient示例详解

《css渐变色背景|<gradient示例详解》CSS渐变是一种从一种颜色平滑过渡到另一种颜色的效果,可以作为元素的背景,它包括线性渐变、径向渐变和锥形渐变,本文介绍css渐变色背景|<gradien... 使用渐变色作为背景可以直接将渐China编程变色用作元素的背景,可以看做是一种特殊的背景图片。(是作为背

springboot日期格式化全局LocalDateTime详解

《springboot日期格式化全局LocalDateTime详解》文章主要分析了SpringBoot中ObjectMapper对象的序列化和反序列化过程,并具体探讨了日期格式化问题,通过分析Spri... 目录分析ObjectMapper与jsonSerializer结论自定义日期格式(全局)扩展利用配置