华为、H3C、锐捷交换机开启Telnet/SSH远程管理大总结,太实用了

老杨丨11年资深网络工程师,更多网工提升干货,请关注公众号:网络工程师俱乐部

交换机远程登陆是必做的工作,同时也带来极大的方便,能够通过远程直接进入交换机管理网络,是网工人必会内容。

目前主流的三大网络设备商:华为、h3c、锐捷如何实现?

远程登陆主要有两种方式,Telnet与SSH,这两种方式都有人在使用,今天一起来了解三大网络设备商的这两种登陆方式。

今日文章阅读福利:《 三千多个厂商默认帐号、默认密码(excel版本)》

分享个能用上的好东西,日常工作又轻松拿捏了,好资料不多,务必收藏!

私信发送暗号“密码”,即可限时获取资料哈。

01 华为交换机远程登陆

1、开启Telnet配置

# 创建用户  Ruijie> enable  Ruijie# configure terminal  Ruijie(config)# username admin privilege 15 password Ruijie@123  # 启用服务  Ruijie(config)# enable service telnet-server  # VTY配置  Ruijie(config)# line vty 0 4  Ruijie(config-line)# login local  Ruijie(config-line)# transport input telnet

2、开启SSH配置

# 生成密钥对  [Huawei] dsa local-key-pair create  

[Huawei] rsa local-key-pair create &nbsp;# 创建管理用户 &nbsp;<Huawei> system-view &nbsp;[Huawei] aaa &nbsp;[Huawei-aaa] local-user admin password cipher Huawei@123 &nbsp;[Huawei-aaa] local-user admin privilege level 15 &nbsp;[Huawei-aaa] local-user admin service-type ssh &nbsp;

# 配置SSH服务 &nbsp;[Huawei] stelnet server&nbsp;enable&nbsp;&nbsp;[Huawei] ssh user admin authentication-type password &nbsp;[Huawei] ssh user admin service-type stelnet &nbsp;# VTY线路启用SSH &nbsp;

[Huawei] user-interface vty 0 4 &nbsp;[Huawei-ui-vty0-4] authentication-mode aaa &nbsp;

[Huawei-ui-vty0-4] protocol inbound ssh

02&nbsp;H3C交换机远程登陆

1、开启Telnet配置

# 创建用户并授权 &nbsp;<H3C> system-view &nbsp;[H3C] local-user admin class manage &nbsp;[H3C-luser-manage-admin] password simple H3C@123 &nbsp;[H3C-luser-manage-admin] service-type telnet &nbsp;[H3C-luser-manage-admin] authorization-attribute user-role network-admin &nbsp;# VTY配置 &nbsp;[H3C] line vty 0 63 &nbsp;[H3C-line-vty0-63] authentication-mode scheme &nbsp;[H3C-line-vty0-63] protocol inbound telnet

2、开启SSH配置

# 生成密钥 &nbsp;[H3C] public-key&nbsp;local&nbsp;create rsa &nbsp;

[H3C] public-key&nbsp;local&nbsp;create dsa &nbsp;# 创建用户并授权 &nbsp;<H3C> system-view &nbsp;[H3C] local-user admin class manage &nbsp;[H3C-luser-manage-admin] password simple H3C@123 &nbsp;[H3C-luser-manage-admin] service-type telnet &nbsp;[H3C-luser-manage-admin] authorization-attribute user-role network-admin&nbsp;

# 启用SSH服务 &nbsp;

[H3C] ssh server&nbsp;enable&nbsp;&nbsp;[H3C] ssh user admin service-type stelnet authentication-type password

[H3C] line vty 0 63 &nbsp;[H3C-line-vty0-63] authentication-mode scheme &nbsp;[H3C-line-vty0-63] protocol inbound ssh

03&nbsp;锐捷交换机远程登陆

1、开启Telnet配置

# 创建用户 &nbsp;Ruijie>&nbsp;enable&nbsp;&nbsp;Ruijie# configure terminal &nbsp;Ruijie(config)# username admin privilege 15 password Ruijie@123 &nbsp;# 启用服务 &nbsp;Ruijie(config)# enable service telnet-server &nbsp;# VTY配置 &nbsp;Ruijie(config)# line vty 0 4 &nbsp;Ruijie(config-line)# login local &nbsp;Ruijie(config-line)# transport input telnet

2、开启SSH配置

# 生成密钥 &nbsp;Ruijie(config)# crypto key generate rsa &nbsp;Ruijie(config)# ip ssh version 2 &nbsp;# 配置SSH参数 &nbsp;Ruijie(config)# username admin sshkey "ssh-rsa AAAAB3NzaC1yc..." &nbsp;Ruijie(config-line)# transport input ssh

04&nbsp;Telnet/SSH用法示例

为了方便大家更能理解与应用,我们来对这两种方式各举一个详细的配置例子。

一、华为交换机Telnet远程如何配置实现?

示例一、华为交换机配置Telnet连接登陆方式

1、连接交换机

我们在拿到新的交换机后,想要配置远程登陆交换机,首先就需要通过Console口登录交换机。

2、如何配置Telnet远程登陆

上面我们通过了Console口登录了,在项目中,肯定还是需要远程登录和管理交换机,就可以在交换机上配置Telnet服务功能并使用AAA验证方式登录。

我们以华为交换机为例,来配置交换机的远程登陆。

步骤1:从PC1通过交换机Console口登录交换机。

这个上面已经完成了。

步骤2:配置交换机名称和管理IP地址。

<Quidway>system-view

[Quidway] sysname S &nbsp; &nbsp;&nbsp;//更交换机名为Server

[S] interface ethernet 0/0/0 &nbsp; &nbsp;&nbsp;//进入端口0/0/0

[S-Ethernet0/0/0] ip address 10.10.10.10 255.255.255.0 &nbsp; &nbsp;//配置管理 ip地址。

[S-Ethernet0/0/0] quit &nbsp; &nbsp;&nbsp; //返回

步骤3:配置Telnet用户的级别和认证方式。

[S] telnet server enable &nbsp; &nbsp; &nbsp;&nbsp;//开启Telnet功能。

[S] user-interface vty 0 4 &nbsp; &nbsp;&nbsp;//进入VTY 0~VTY 4用户界面视图,同时支持0到4,5个用户在线操作。

[S-ui-vty0-4] user privilege level 15 &nbsp; &nbsp;//配置VTY 0~VTY 4的用户级别为15级。

[Sr-ui-vty0-4] authentication-mode aaa &nbsp; &nbsp;&nbsp;//配置VTY 0~VTY 4的用户认证方式为AAA认证。

注意:

这里解释下这个AAA认证。认证方式,有三种:

AAA(同时输入正确的用户名和密码才能登录);

one(不用认证)

password(输入正确的密码就可登录)认证,

可以根据需要选择,所以我们选择AAA。

[S-ui-vty0-4] quit &nbsp;&nbsp;&nbsp; //返回

[S] aaa &nbsp; &nbsp;//进入AAA认证

[S-aaa] local-user admin123 password irreversible-cipher helloworld@6789 &nbsp; &nbsp;&nbsp;&nbsp; //创建名为admin123的本地用户,设置其登录密码为helloworld@6789 &nbsp;。

这里面的,irreversible-cipher有必要解释下, &nbsp;表示对用户密码采用不可逆算法进行了加密,使非法用户无法通过解密算法特殊处理后得到明文密码,为用户提供更好的安全保障。

[S-aaa] local-user admin1234 privilege level 15 &nbsp; &nbsp;&nbsp;//配置用户级别为15级。

[S-aaa] local-user admin1234 service-type telnet &nbsp; &nbsp;&nbsp;//配置接入类型为telnet,即:Telnet用户。

[S-aaa] quit

步骤4:从PC2以Telnet方式登录交换机。

以进入Windows运行窗口,并执行相关命令,通过Telnet方式登录交换机为例:

&nbsp;

单击“确定”后,在登录窗口输入用户名和密码,验证通过后,出现用户视图的命令行提示符。表示登录成功。

二、锐捷交换机SSH远程如何配置实现?

2:锐捷交换机配置SSH远程登陆管理

上面我们提到了关于华为交换机配置Telnet远程登陆,那么ssh远程登陆如何实现呢?本期我们就来了解下ssh远程登陆的方式,以锐捷交换机为例。

一、配置思路

配置ssh远程登陆,一般是有四个步骤:

1、首先选择Console方式登陆交换机

2、开启交换机的SSH服务功能并配置IP

3、生成加密密钥

4、配置SSH管理的登入口令

二、配置步骤(以锐捷交换机的配置为例)

1、首先选择Console方式登陆交换机

2、开启交换机的SSH服务功能并配置IP

switch>enable &nbsp; &nbsp; //进入特权模式

switch#configure terminal &nbsp; &nbsp; //进入全局配置模式

switch(config)#enable service ssh-server &nbsp; &nbsp; //开启ssh-server

switch(config)#interface vlan 1 &nbsp; &nbsp; &nbsp; //进入vlan 1接口

switch(config-if)#ip address 192.168.1.1 255.255.255.0 &nbsp; &nbsp;//为vlan 1接口上设置管理ip 192.168.1.1

switch(config-if)#exit //退回到全局配置模式

3、生成加密密钥

switch(config)#crypto key generate dsa &nbsp; &nbsp;//加密方式有两种:DSA和RSA,可以随意选择

然后等待密钥生成,然后直接敲回车就好

4、配置SSH管理的登入口令

switch(config)#line vty 0 4 &nbsp; &nbsp; //进入SSH密码配置模式,0 4表示允许共5个用户同时SSH登入到交换机

switch(config-line)#login local &nbsp; &nbsp;//启用SSH时使用本地用户和密码功能

switch(config-line)#transport input ssh &nbsp; &nbsp;//设置传输模式是SSH,设置远程登入只允许使用SSH登入,不能使用telnet登入

switch(config-line)#exit &nbsp; &nbsp; //回到全局配置模式

switch(config)#username Ruijie password 123456 //配置远程登入的用户名为Ruijie,密码为123456

switch(config)#end &nbsp; &nbsp; //退出到特权模式

switch#write &nbsp; &nbsp; &nbsp; //确认配置正确,保存配置

5、验证命令(查看SSH的参数信息(版本信息,重认证次数等参数)

switch#show ip ssh &nbsp; &nbsp;//显示配置信息

然后就配置完了,从配置中可以看出,ssh远程登陆方式确实比telnet要安全一些,适用于企业中。

三、远程登陆进入

配置后了ssh远程登陆后,可以使用PUTTY或者SecureCRT远程登陆就行。

用刚刚配置的ip地址,及用户名和密码进行登陆,我们就是SecureCRT登陆为例。

那么,这个就ssh远程登陆成功了。

配置需要开启SSH功能,且PC与交换机在同一个网段,如果不在的话,可以设置下网关。

可以用show service命令确认SSH服务功能是否开启。


 

整理:老杨丨11年资深网络工程师,更多网工提升干货,请关注公众号:网络工程师俱乐部

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值