华为交换机配置console、telnet、ssh登录

文章目录

  • 一、console登录配置
  • 二、telnet登录配置
  • 三、ssh登录配置

一、console登录配置

1、配置密码登录

<Huawei>system-view 
[Huawei]user-interface console 0    #进入到console接口视图
[Huawei-ui-console0]authentication-mode password    #设置认证模式为password
Please configure the login password (maximum length 16):huawei@123   #设置密码
[Huawei-ui-console0]user privilege level 3    #授予登录时的用户级别为3

2、配置账号密码登录

<Huawei>system-view 
[Huawei]user-interface console 0    #进入到console接口视图
[Huawei-ui-console0]authentication-mode aaa  #设置认证模式为aaa
[Huawei-ui-console0]aaa   #进入aaa视图
[Huawei-aaa]local-user user01 password cipher huawei@123  #设置账号为user01密码为huawei@123
Info: Add a new user.
[Huawei-aaa]local-user user01 privilege level 3  #授予登录时的用户级别为3

二、telnet登录配置

1、配置密码登录

<Huawei>system-view 
[Huawei]user-interface vty 0 4   #进入到vty接口视图
[Huawei-ui-console0]authentication-mode password    #设置认证模式为password
Please configure the login password (maximum length 16):huawei@123   #设置密码
[Huawei-ui-console0]user privilege level 3    #授予登录时的用户级别为3
#配置完以后在PC上使用“telnet  交换机地址”   进行登录

2、配置账号密码登录

<Huawei>system-view 
[Huawei]user-interface vty 0 4   #进入到vty接口视图
[Huawei-ui-console0]authentication-mode aaa  #设置认证模式为aaa
[Huawei-ui-console0]aaa   #进入aaa视图
[Huawei-aaa]local-user user01 password cipher huawei@123  #设置账号为user01密码为huawei@123
Info: Add a new user.
[Huawei-aaa]local-user user01 privilege level 3  #授予登录时的用户级别为3
#配置完以后在PC上使用“telnet  交换机地址”   进行登录

三、ssh登录配置

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]rsa local-key-pair create                    #创建秘钥
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y               #秘钥已存在,是否继续
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]:1024   #秘钥长度,默认512,自己选择长度,越长加密越安全
Generating keys...
...............................................++++++
.............++++++
.........................++++++++
................................++++++++
[Huawei]aaa                                         #进入aaa视图
[Huawei-aaa]local-user admin password cipher 123456   #创建用户admin,密码123456
[Huawei-aaa]local-user admin privilege level 3   #授予登录时的用户级别为3
[Huawei-aaa]local-user admin service-type ssh    #设置这个admin用户只能用于ssh
[Huawei-aaa]quit                                 #退出退出aaa视图
[Huawei]stelnet server enable                    #启动stelnet服务
Info: Succeeded in starting the STELNET server.
[Huawei]ssh user admin authentication-type password    #设置ssh用户是admin,认证方式的密码
 Authentication type setted, and will be in effect next time
[Huawei]user-interface vty 0 4                         #进入用户接口
[Huawei-ui-vty0-4]authentication-mode aaa              #设置认证模式是aaa
[Huawei-ui-vty0-4]protocol inbound ssh                 #表示只能通过ssh登录,telnet就登录不了了,设置为protocol inbound all就都可以登录
#配置完成后就要可以通过工具ssh连接了

你可能感兴趣的:(datacom,华为,网络)