赞
踩
server服务器地址:192.168.1.1/24
client客户端地址:192.168.1.2/24
华为设备,配置telnet服务的流程为:
开启telnet服务(华为设备默认开启)
创建用于telnet服务的用户
配置vty终端实现使用telnet登录
Server 设备配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Server
[Server]int g0/0/0
[Server-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[Server-GigabitEthernet0/0/0]
Nov 27 2022 19:53:46-08:00 Server %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Server-GigabitEthernet0/0/0]q
#可以发现每对设备进行操作都会回显一些信息出来,为了美观的同时防止误认为是报错,可以将提示信息取消显示
[Server]undo info-center enable
Info: Information center is disabled.
#关闭之后,后继操作将不会有过多的内容显示
[Server]aaa
[Server-aaa]local-user telneter password cipher telneter privilege level 15
Info: Add a new user.
命令解释:
local-user telneter password cipher telneter privilege level 15
用户名 用户密码 权限等级
[Server-aaa]local-user telneter service-type telnet
命令解释:仅允许telneter用户登录telnet服务
[Server]telnet server enable
Error: TELNET server has been enabled #因为telnet默认已经开启
[Server]user-interface vty 0 4
[Server-ui-vty0-4]authentication-mode aaa #配置认证模式为aaa,也就是使用 用户密码来登录
[Server-ui-vty0-4]protocol inbound telnet #配置仅允许使用telnet 的方式进行登录到vty 0~4中
如果你是想配置密码的方式来登录:
[Server-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123456 #输入密码即可
Client 设备配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Client
[Client]un in en
Info: Information center is disabled.
[Client]int g0/0/0
[Client-GigabitEthernet0/0/0]ip add 192.168.1.2 24
[Client-GigabitEthernet0/0/0]q
[Client]q
<Client> telnet 192.168.1.1 #telnet连接server服务器
Press CTRL_] to quit telnet mode
Trying 192.168.1.1 ...
Connected to 192.168.1.1 ...
Login authentication
Username:telneter #输入账号
Password: #输入密码
<Server>sys #成功连接
Enter system view, return user view with Ctrl+Z.
[Server] #能够进入系统模式,表示拥有15的权限(管理权限)
小技巧:ENSP软件环境中可通过右键ENSP设备,查看设备串中号,从而在CRT中进行telnet连接:127.0.0.1:串口号
,进行连接该设备
server服务器地址:192.168.1.1/24
client客户端地址:192.168.1.2/24
建议基于上一个telnet环境进行ssh的操作,这样方便测试telneter用户只能用于telnet,ssher用户只能用于ssh。
华为设备,配置ssh服务的流程为:
开启ssh服务
创建用于ssh服务的用户,在ssh上进行绑定ssh用户
配置vty终端实现ssh服务
Server 设备配置
[Server]aaa [Server-aaa]local-user ssher password cipher ssher privilege level 15 [Server-aaa]local-user ssher service-type ssh [Server-aaa]q #将ssher用户添加到ssh用户列表中 [Server]ssh user ssher authentication-type password Authentication type setted, and will be in effect next time #查看ssh用户列表 [Server]display ssh user-information ------------------------------------------------------------------------------- Username Auth-type User-public-key-name ------------------------------------------------------------------------------- ssher password null -------------------------------------------------------------------------------
#开启ssh服务
[Server]stelnet server enable
Info: Succeeded in starting the STELNET server.
#配置vty终端
[Server]user-interface vty 0 4
[Server-ui-vty0-4]authentication-mode aaa
[Server-ui-vty0-4]protocol inbound all #因需要测试telnet与ssh,所以开启all
Client 设备配置
<Client>system-view Enter system view, return user view with Ctrl+Z. #注意,ssh连接需要在系统视图下进行,通过命令stelnet进行ssh连接 [Client]stelnet 192.168.1.1 Please input the username:ssher Trying 192.168.1.1 ... Press CTRL+K to abort Connected to 192.168.1.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. #第一次进行连接的时候,提示你需要进行输入命令:ssh client first-time enable [Client]ssh client first-time enable #再次ssh连接 [Client]stelnet 192.168.1.1 Please input the username:ssher Trying 192.168.1.1 ... Press CTRL+K to abort Connected to 192.168.1.1 ... #服务器未通过身份验证。是否继续访问? The server is not authenticated. Continue to access it? (y/n)[n]:y #是否保存服务器的公钥? Save the server's public key? (y/n)[n]:y The server's public key will be saved with the name 192.168.1.1. Please wait... #最后输入ssher用户的密码,即可连接成功 Enter password: <Server>sys Enter system view, return user view with Ctrl+Z.
[Client]stelnet 192.168.1.1
Please input the username:telnter
Trying 192.168.1.1 ...
Press CTRL+K to abort
Connected to 192.168.1.1 ...
Enter password:
Enter password:
Enter password:
Info: The connection was closed by the remote host.
<Client>telnet 192.168.1.1
Press CTRL_] to quit telnet mode
Trying 192.168.1.1 ...
Connected to 192.168.1.1 ...
Login authentication
Username:ssher
Password:
Error: Local authentication is rejected.
Logged Fail!
local-user ssher service-type 服务类型
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。