华为交换机开启ssh登录

配置思路:

1. 交换机配置IP

2.生成密钥

3.配置VTY 

4.创建ssh用户,配置password认证

5.开启stelnet功能

配置如下:

< HUAWEI >

< HUAWEI >sys 

Entersystem view, return user view with Ctrl+Z.

[HUAWEI]  intterface   Vlanif    1                                                                //配置交换机管理IP

[HUAWEI-Vlanif1]  ip  addr  192.168.56.2  24

[HUAWEI-Vlanif1]  quit

[HUAWEI]  undo  telnet   server   enable                                             //关闭telnet服务

Warning:The operation will stop the Telnet server. Continue? [Y/N]:y

[HUAWEI]  quit

[HUAWEI]  rsa  local-key-pair   create                                                    //生成密钥

Thekey name will be: HUAWEI_Host

Therange of public key size is (512 ~ 2048).

NOTES:If the key modulus is greater than 512,

       it will take a few minutes.

Inputthe bits in the modulus[default = 512]:2048

Generatingkeys...

...............................................+++

.....................................................................+++

........................++++++++

....++++++++


[HUAWEI]  user-interface  vty   0   4                                                       //配置VTY

[HUAWEI-ui-vty0-4]  authentication-mode  aaa

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

[HUAWEI-ui-vty0-4]  quit

[HUAWEI]  ssh  user   huawei                                                                //添加ssh用户

Info:Succeeded in adding a new SSH user.

[HUAWEI]  ssh  user  huawei   authentication-type   password

[HUAWEI]  aaa                                                                                            //AAA中添加用户

[HUAWEI-aaa]  local-user  huawei  password  cipher  huawei

Info:Add a new user.

[HUAWEI-aaa]  local-user  huawei  service-type  ssh

[HUAWEI-aaa]  quit

[HUAWEI]  ssh  user   huawei   service-type   stelnet

[HUAWEI]   stelnet  server  enable                                                        //启用stelnet服务

Info:Succeeded in starting the Stelnet server.

[HUAWEI]  quit

 save

Thecurrent configuration will be written to the device.

Areyou sure to continue?[Y/N]  y

Nowsaving the current configuration to the slot 0.

Savethe configuration successfully.

你可能感兴趣的:(华为交换机开启ssh登录)